Skip to content

Instantly share code, notes, and snippets.

@danielcodes
Created March 17, 2018 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielcodes/8e6ee3eea155d9e6bcd191e8f7bbab6d to your computer and use it in GitHub Desktop.
Save danielcodes/8e6ee3eea155d9e6bcd191e8f7bbab6d to your computer and use it in GitHub Desktop.
Nginx config file for Pollster
upstream app_server {
server unix:/home/daniel/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
root /home/daniel/voting_app/client/build;
server_name <your_server_ip>;
index index.html index.htm;
keepalive_timeout 5;
client_max_body_size 4G;
access_log /home/daniel/logs/nginx-access.log;
error_log /home/daniel/logs/nginx-error.log;
location / {
try_files $uri /index.html;
}
location /api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment