Skip to content

Instantly share code, notes, and snippets.

@fortl
Created January 26, 2016 17:49
Show Gist options
  • Save fortl/38e1eabbe6a2c45ebcad to your computer and use it in GitHub Desktop.
Save fortl/38e1eabbe6a2c45ebcad to your computer and use it in GitHub Desktop.
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /nginx/logs/access.log main;
error_log /nginx/logs/error.log;
error_log /nginx/logs/error.log notice;
error_log /nginx/logs/error.log info;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
client_body_timeout 300s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
send_timeout 300s;
gzip on;
server {
set $username ty;
set $basicauth dGhla2lwOnllczFkbzF0;
listen 80;
listen 443 ssl;
ssl_certificate /nginx/keys/dev.plurch.com.crt;
ssl_certificate_key /nginx/keys/dev.plurch.com.key;
server_name _;
root C:/timescenery/front/public/files;
client_max_body_size 60m;
######Proxy headers
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-HTTPS $http_https;
include includes/locations.conf;
}
}
location /cache.appcache {
open_file_cache off;
open_file_cache_errors off;
expires -1;
default_type text/cache-manifest;
# access_log logs/static.log; # I don't usually include a static log
}
location = /cache.appcache {
expires -1;
default_type text/cache-manifest;
}
location ~ /(css|fonts|files|i|j)/ {
expires -1;
add_header Cache-Control public;
access_log /nginx/logs/timedesigner-assets.access.log main;
open_file_cache off;
}
location /api/ {
proxy_pass http://$username.dev.time.sc;
access_log /nginx/logs/server.access.log main;
proxy_set_header Authorization "Basic ${basicauth}";
}
set $is_landing landing;
if ( $cookie_token ) { set $is_landing nolanding; }
location / {
open_file_cache off;
open_file_cache_errors off;
expires -1;
add_header Cache-Control public;
try_files /root/$uri @$is_landing;
}
location @nolanding {
try_files $uri /index.html;
}
location @landing {
try_files $uri /beta/index.html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment