1
0
Fork 0
mirror of synced 2024-05-16 02:42:20 +12:00
waifu2x/appendix/waifu2x.nginx.conf

53 lines
1 KiB
Plaintext
Raw Normal View History

2015-05-17 18:28:02 +12:00
upstream waifu2x {
2016-02-12 23:06:45 +13:00
least_conn;
2015-05-17 18:28:02 +12:00
server localhost:8812;
2016-02-12 23:06:45 +13:00
# ..
2015-05-17 18:28:02 +12:00
}
2016-02-12 23:06:45 +13:00
2015-08-13 02:01:45 +12:00
map $http_accept_language $lang {
default en;
2016-02-12 23:06:45 +13:00
~ja ja;
2015-09-07 18:16:44 +12:00
~ru ru;
2016-02-12 23:06:45 +13:00
~pt pt;
~es es;
2016-02-22 23:15:20 +13:00
~fr fr;
2016-04-09 00:01:39 +12:00
~de de;
2016-04-15 09:48:33 +12:00
~tr tr;
2016-04-17 02:55:38 +12:00
~zh-CN zh-CN;
2016-07-21 22:37:31 +12:00
~zh-TW zh-TW;
2016-04-17 02:55:38 +12:00
~zh zh-CN;
2016-05-10 22:21:18 +12:00
~ko ko;
2017-02-18 02:53:10 +13:00
~nl nl;
2017-05-22 09:35:56 +12:00
~ca ca;
~ro ro;
2020-01-10 09:24:32 +13:00
~it it;
~eo eo;
2020-03-26 14:59:11 +13:00
~no no;
2020-10-04 18:08:03 +13:00
~uk uk;
2021-01-28 12:13:33 +13:00
~pl pl;
2016-02-16 23:26:38 +13:00
~en en;
2015-08-13 02:01:45 +12:00
}
2016-02-12 23:06:45 +13:00
#limit_req_zone $binary_remote_addr zone=one:128m rate=10r/m;
2015-05-17 18:28:02 +12:00
server {
2015-08-13 02:01:45 +12:00
# listen 80 default_server;
server_name waifu2x.udp.jp; # fill your domain
2015-05-17 18:28:02 +12:00
2015-08-13 02:01:45 +12:00
access_log /var/log/nginx/waifu2x.access.log;
2015-05-17 18:28:02 +12:00
root /home/ubuntu/waifu2x/assets;
2015-08-13 02:01:45 +12:00
try_files $uri $uri/index.$lang.html $uri/index.html @api;
2015-05-17 18:28:02 +12:00
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;
2016-02-12 23:06:45 +13:00
location ~ ^/(apple-touch-icon|browserconfig|mstile)(.*)\.(png|xml|ico)$ {
2015-08-13 02:01:45 +12:00
return 204;
}
location @api {
2016-02-12 23:06:45 +13:00
# limit_req zone=one burst=3;
2015-05-17 18:28:02 +12:00
proxy_pass http://waifu2x;
}
}