Skip to content

Instantly share code, notes, and snippets.

@kyledrake
Created June 3, 2013 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyledrake/5697330 to your computer and use it in GitHub Desktop.
Save kyledrake/5697330 to your computer and use it in GitHub Desktop.
server {
root /home/web/neocities-web/public;
server_name neocities.org www.neocities.org;
# location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
# expires 60s;
# log_not_found off;
# }
try_files $uri @neocities;
location @neocities {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_max_temp_file_size 0;
proxy_pass http://127.0.0.1:20000;
break;
}
}
server {
server_name ~^(?<subdomain>.+)\.neocities.org$;
root /home/web/neocities-web/public/sites/$subdomain;
index /index.html;
error_page 404 = /not_found.html;
location ~* \.(html|jpg|jpeg|png|gif|ico|css|js)$ {
expires 20s;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment