Skip to content

Instantly share code, notes, and snippets.

@dipaktc
Created May 10, 2017 13:26
Show Gist options
  • Save dipaktc/674d51b8821f9aaf042776d1235ec02b to your computer and use it in GitHub Desktop.
Save dipaktc/674d51b8821f9aaf042776d1235ec02b to your computer and use it in GitHub Desktop.
upstream app_server {
server 10.138.0.3:8080;
}
server {
listen 80;
index index.html;
server_name xx.xxx.xxx.xx;
root /home/dev/PROJECT-NAME/current/public;
location / {
if (-f $request_filename/index.html) {
rewrite (.*) $1/index.html break;
}
if (-f $request_filename.html) {
rewrite (.*) $1.html break;
}
if (!-f $request_filename) {
proxy_pass http://app_server;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment