Created
June 5, 2014 15:16
-
-
Save bmelton/df8b8964bc2770fa2aba 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 supportclassrooms { | |
server 127.0.0.1:8003; | |
} | |
upstream socketclassrooms { | |
server 127.0.0.1:8004; | |
} | |
server { | |
listen 80; ## listen for ipv4; this line is default and implied | |
root /home/bmelton/projects/supportclassrooms/supportclassrooms; | |
index index.html index.htm; | |
# Make site accessible from http://localhost/ | |
server_name supportclassrooms.com www.supportclassrooms.com supportclassrooms.org www.supportclassrooms.org ; | |
location ~* ^.+\.(woff|ttf|svg|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov|html) { | |
access_log off; | |
expires 30d; | |
} | |
location / { | |
try_files $uri @proxy_to_app; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_redirect off; | |
} | |
# location /ws/ { | |
# try_files $uri @proxy_to_socket; | |
# } | |
location @proxy_to_app { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://supportclassrooms; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_redirect off; | |
} | |
location @proxy_to_socket { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://socketclassrooms; | |
} | |
location /static { | |
root /home/bmelton/projects/supportclassrooms/supportclassrooms/static; | |
autoindex on; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment