Skip to content

Instantly share code, notes, and snippets.

@pasikonik
Last active December 23, 2018 11:08
Show Gist options
  • Save pasikonik/9a53074e91c096add89752e03a8c2da6 to your computer and use it in GitHub Desktop.
Save pasikonik/9a53074e91c096add89752e03a8c2da6 to your computer and use it in GitHub Desktop.
Nginx configuration for Rails API only
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream app {
server unix:/var/www/hajsapp/shared/sockets/puma.sock;
}
server {
listen 80;
server_name api.hajsapp.pl;
root /var/www/hajsapp/current/public;
try_files $uri/index.html $uri @app;
location @app {
proxy_pass http://app;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
error_page 500 502 503 504 /error.json;
client_max_body_size 4G;
keepalive_timeout 10;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment