-
-
Save jaigouk/bc095e842b0ef651407b to your computer and use it in GitHub Desktop.
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
upstream haproxy { | |
server 127.0.0.1:9000; | |
} | |
upstream stats { | |
server 127.0.0.1:9999; | |
} | |
server { | |
listen 80; ## listen for ipv4; this line is default and implied | |
#listen [::]:80 default ipv6only=on; ## listen for ipv6 | |
# Make site accessible from http://localhost/ | |
server_name localhost; | |
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|font/|fonts/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) { | |
root /home/deploy/www/pegleg/current/bundle/static; | |
access_log off; | |
expires max; | |
} | |
location ~* \.(js|css)$ { | |
root /home/deploy/www/pegleg/current/bundle/static_cacheable; | |
access_log off; | |
expires max; | |
} | |
location /haproxy { | |
proxy_redirect off; | |
proxy_pass http://stats; | |
proxy_set_header Connection ""; | |
proxy_http_version 1.1; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
location / { | |
proxy_redirect off; | |
proxy_pass http://haproxy; | |
proxy_set_header Connection ""; | |
proxy_http_version 1.1; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment