2023-01-22 09:53:09 +00:00
|
|
|
server {
|
2023-04-13 05:46:35 +00:00
|
|
|
server_name {{#dns}} {{.}} {{/dns}};
|
2023-05-16 08:31:27 +00:00
|
|
|
access_log {{{nginx.logs}}}.access.log main;
|
2023-04-27 04:17:20 +00:00
|
|
|
|
|
|
|
location ~* /nationchains/(schema|blocks|pagans|towns|nations)/ {
|
|
|
|
# Warning: never add tribes for keeping it private
|
2023-05-16 08:31:27 +00:00
|
|
|
root {{{dirapi}}}/;
|
2023-04-27 04:17:20 +00:00
|
|
|
}
|
2023-04-28 11:21:02 +00:00
|
|
|
|
2023-01-22 09:53:09 +00:00
|
|
|
# /plugins/pluginame/components/xxx?plugin=pluginname&pluginkey=key
|
|
|
|
# acess if exist pluginkey
|
|
|
|
location /plugins/ {
|
|
|
|
add_header X-debug "plugins local $arg_plugin/keys/$arg_pluginkey sent";
|
2023-05-16 08:31:27 +00:00
|
|
|
root {{{nginx.fswww}}}/plugins/;
|
|
|
|
if (-f {{{nginx.fswww}}}/plugins/$arg_plugin/keys/$arg_pluginkey) {
|
2023-01-22 09:53:09 +00:00
|
|
|
rewrite /plugins/([^/]+)/components/([^\?]+) /$1/components/$2 break;
|
|
|
|
}
|
|
|
|
return 403 "No valid token access for plugin:$arg_plugin with token:$arg_pluginkey please ask your admin";
|
|
|
|
}
|
|
|
|
|
|
|
|
location /cdn/ {
|
|
|
|
rewrite /cdn/(.*$) /$1 break;
|
2023-05-16 08:31:27 +00:00
|
|
|
root {{{nginx.fswww}}}www/cdn/;
|
2023-01-22 09:53:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
location /spacedev/ {
|
|
|
|
rewrite /spacedev/(.*$) /$1 break;
|
2023-05-16 08:31:27 +00:00
|
|
|
root {{{nginx.fswww}}}spacedev/{{{nginx.website}}}/dist/;
|
2023-01-22 09:53:09 +00:00
|
|
|
}
|
2023-04-27 04:17:20 +00:00
|
|
|
|
|
|
|
location /api/ {
|
|
|
|
rewrite /api/(.*$) /$1 break;
|
|
|
|
proxy_pass http://localhost:{{{api.port}}};
|
2023-01-22 09:53:09 +00:00
|
|
|
proxy_redirect off;
|
2023-04-27 04:17:20 +00:00
|
|
|
include proxy_params;
|
2023-01-22 09:53:09 +00:00
|
|
|
}
|
2023-04-27 04:17:20 +00:00
|
|
|
|
2023-01-22 09:53:09 +00:00
|
|
|
location / {
|
2023-05-16 08:31:27 +00:00
|
|
|
root {{{nginx.fswww}}}/{{{nginx.website}}};
|
2023-04-27 04:17:20 +00:00
|
|
|
index index.html {{{nginx.pageindex}}};
|
2023-01-22 09:53:09 +00:00
|
|
|
}
|
|
|
|
error_page 404 /404.html;
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
|
|
#
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location = /50x.html {
|
|
|
|
root /usr/local/nginx/html;
|
|
|
|
}
|
|
|
|
}
|