Skip to content

Instantly share code, notes, and snippets.

@khoden
Created March 3, 2016 11:49
Show Gist options
  • Select an option

  • Save khoden/57f533a6a70f0509c2c0 to your computer and use it in GitHub Desktop.

Select an option

Save khoden/57f533a6a70f0509c2c0 to your computer and use it in GitHub Desktop.
# static server
server {
listen 80;
server_name beta.sociotex.com;
location /.well-known {
root /usr/share/nginx/html;
}
rewrite ^ https://$server_name$request_uri?;
}
server {
listen 443 ssl;
server_name beta.sociotex.com;
ssl_certificate /etc/letsencrypt/live/beta.sociotex.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/beta.sociotex.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
root /projects/sociotex/frontend;
location = /manifest.appcache {
expires off;
add_header "Cache-Control" "max-age=0, no-cache";
}
location /uploads {
root /projects/sociotex;
}
location / {
rewrite \/[^.]*$ /index.html;
location ~* \.\w+$ {
log_not_found off;
access_log off;
gzip on;
gzip_min_length 1000;
gzip_types application/json application/javascript text/css application/x-javascript;
}
}
}
# api server
server {
listen 80;
server_name api.sociotex.com;
location /.well-known {
root /usr/share/nginx/html;
}
rewrite ^ https://$server_name$request_uri?;
}
server {
listen 443 ssl;
server_name beta-api.sociotex.com;
ssl_certificate /etc/letsencrypt/live/beta.sociotex.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/beta.sociotex.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
location / {
error_log /projects/sociotex/logs/nginx_api_error.log;
access_log /projects/sociotex/logs/nginx_api_access.log;
client_max_body_size 300m;
client_body_timeout 1200;
send_timeout 1200;
uwsgi_connect_timeout 75;
uwsgi_read_timeout 1200;
uwsgi_send_timeout 1200;
include uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_pass unix:///tmp/sociotex.sock;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment