Skip to content

Instantly share code, notes, and snippets.

@killercup
Last active December 21, 2015 19:08
Show Gist options
  • Save killercup/6351752 to your computer and use it in GitHub Desktop.
Save killercup/6351752 to your computer and use it in GitHub Desktop.
ATRIC nginx config <https://github.com/killercup/atric>
upstream atric-node {
server 127.0.0.1:3000;
keepalive 64;
}
server {
listen 80;
server_name atric.flabs.org;
root /home/app/atric/public;
access_log off;
location @node {
proxy_pass http://atric-node;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Connection "";
proxy_http_version 1.1;
}
location / {
expires max;
gzip on;
gzip_types text/plain application/xml text/css text/js text/xml application/javascript application/x-javascript text/javascript application/json application/xml+rss;
add_header Cache-Control public;
location ~ ^/$ {
try_files MAINTAINANCE_MODE.html @node;
break;
}
try_files $uri @node;
break;
}
}
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_static on;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype;
include /usr/local/etc/nginx/sites-enabled/*;
server {
listen 80 default_server;
server_name localhost;
location / {
root /var/www/_nginx;
index index.html index.htm;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/_nginx;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment