Skip to content

Instantly share code, notes, and snippets.

@tgoldenberg
Created October 31, 2016 15:08
Show Gist options
  • Select an option

  • Save tgoldenberg/4c720563315c612fc105c5c1cce929ce to your computer and use it in GitHub Desktop.

Select an option

Save tgoldenberg/4c720563315c612fc105c5c1cce929ce to your computer and use it in GitHub Desktop.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/agolo_com.crt;
ssl_certificate_key /etc/ssl/agolo_com.key;
server_name stage.agolo.com www.stage.agolo.com;
location = /favicon.ico {
root /home/will/portal/programs/web.browser/app;
access_log off;
}
location ~* "^/[a-z0-9]{40}\.(css|js)$" {
root /home/will/portal/programs/web.browser;
gzip_static on;
access_log off;
}
location ~* \.(eot|ttf|woff)$ {
root /home/will/portal/programs/web.browser;
access_log off;
add_header Access-Control-Allow-Origin *;
add_header Vary Origin;
add_header Pragma public;
add_header Cache-Control "public";
expires max;
}
location ~ "^/packages" {
root /home/will/portal/programs/web.browser;
access_log off;
}
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
add_header X-uri "$request_uri";
add_header Y-uri "$remote_user";
}
}
server {
listen 80 default;
listen [::]:80 ipv6only=on;
server_name stage.agolo.com www.stage.agolo.com;
location = /www.stage.agolo.com {
return 301;
}
location / {
rewrite ^ https://$server_name$request_uri? permanent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment