Skip to content

Instantly share code, notes, and snippets.

@paulwinex
Created July 28, 2018 16:16
Show Gist options
  • Save paulwinex/3e54bb799eda26f4e8e1e50363c667e0 to your computer and use it in GitHub Desktop.
Save paulwinex/3e54bb799eda26f4e8e1e50363c667e0 to your computer and use it in GitHub Desktop.
upstream project_stream {
server $APP_NAME:$APP_PORT;
}
server {
listen 80;
server_name $PROJECT_HOST;
root /data/src;
index index.html index.htm;
client_max_body_size 100m;
keepalive_timeout 5;
# static
location /static/ {
alias /data/static/;
expires 30d;
}
# media
location /media/ {
alias /data/media/;
}
# favicon
location /favicon.ico {
alias /data/static/favicon.ico;
}
location / {
proxy_pass http://project_stream;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment