Skip to content

Instantly share code, notes, and snippets.

@phoenixlzx
Created February 21, 2014 07:40
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 phoenixlzx/9130273 to your computer and use it in GitHub Desktop.
Save phoenixlzx/9130273 to your computer and use it in GitHub Desktop.
Nyaa.cat NGINX configuration
map $http_accept_language $lang {
default zh_CN;
~en en;
~ca ca;
}
server {
listen [::]:80;
server_name minecraft.phoenixlzx.com;
root /var/www/nyaacat_static_page;
index index.html.$lang;
error_page 404 404.html.$lang;
location / {
try_files $uri $uri/ /index.html.$lang;
}
location ~ \.html$ {
try_files $uri $uri/ $uri.$lang;
}
location /downloads/ {
alias /var/www/minecraft_downloads/;
autoindex on;
charset utf8,bgk;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment