improve nginx config
This commit is contained in:
parent
0b9a8b514c
commit
291a139ed8
|
@ -1,19 +1,28 @@
|
|||
upstream waifu2x {
|
||||
server localhost:8812;
|
||||
}
|
||||
|
||||
map $http_accept_language $lang {
|
||||
default en;
|
||||
~ja ja;
|
||||
~en en;
|
||||
}
|
||||
server {
|
||||
server_name waifu2x.udp.jp;
|
||||
# listen 80 default_server;
|
||||
server_name waifu2x.udp.jp; # fill your domain
|
||||
|
||||
access_log /var/log/nginx/waifu2x.udp.jp.access.log;
|
||||
access_log /var/log/nginx/waifu2x.access.log;
|
||||
|
||||
root /home/ubuntu/waifu2x/assets;
|
||||
try_files $uri $uri/index.$lang.html $uri/index.html @api;
|
||||
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
location / {
|
||||
location ~ ^/(apple-touch-icon|browserconfig|favicon|mstile)(.*)\.(png|xml|ico)$ {
|
||||
return 204;
|
||||
}
|
||||
location @api {
|
||||
proxy_pass http://waifu2x;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue