Created
May 8, 2015 21:07
-
-
Save limhoff-r7/79be3e78a5f1d39edae7 to your computer and use it in GitHub Desktop.
nginx + phoenix configuration to server phoenix behind nginx at path 'phoenix'. nginx rewrites incoming URLs to strip the /phoenix, while the config.exs for phoenix ensures URLs are prefixed with /phoenix using the config.url.path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is responsible for configuring your application | |
# and its dependencies with the aid of the Mix.Config module. | |
# | |
# This configuration file is loaded before any dependency and | |
# is restricted to this project. | |
use Mix.Config | |
# Configures the namespace used by Phoenix generators | |
config :my_app, | |
app_namespace: MyApp | |
# Configures the endpoint | |
config :my_app, MyApp.Endpoint, | |
url: [host: "localhost", path: "/phoenix"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http { | |
upstream phoenix_upstream { | |
server 127.0.0.1:4000; | |
} | |
server { | |
location /phoenix { | |
proxy_redirect off; | |
rewrite /phoenix(.*) /$1 break; | |
proxy_pass http://phoenix_upstream; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment