Skip to content

[Web app] Nginx configuration (en)

FPierre edited this page Jul 5, 2016 · 1 revision
upstream dot_web_app_puma {
  server [UNIX_SOCKET];
}

server {
  listen 80;
  server_name [SERVER_NAME];
  root [ROOT];

  access_log /var/log/nginx/dot_web_app.access.log;
  error_log /var/log/nginx/dot_web_app.error.log info;

#  location ^~ /assets/ {
#    gzip_static on;
#    expires max;
#    add_header Cache-Control public;
#  }

  try_files $uri/index.html $uri @dot_web_app_puma;
  location @dot_web_app_puma {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    proxy_pass http://dot_web_app_puma;
  }

  # location / {
  #   proxy_pass http://puma;
  #   proxy_set_header Host $host;
  #   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  # }

  #error_page 500 502 503 504 /500.html;
  #client_max_body_size 10M;
  #keepalive_timeout 10;
}