apxtrib/adminapi/www/adminapx/conf/nginxmodelwebsite.conf.mustache

54 lines
1.6 KiB
Plaintext
Executable File

server {
server_name {{#dns}} {{.}} {{/dns}};
access_log {{{nginx.logs}}}.access.log main;
location ~* /nationchains/(schema|blocks|pagans|towns|nations)/ {
# Warning: never add tribes for keeping it private
root {{{dirapi}}}/;
}
# /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";
root {{{nginx.fswww}}}/plugins/;
if (-f {{{nginx.fswww}}}/plugins/$arg_plugin/keys/$arg_pluginkey) {
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;
root {{{nginx.fswww}}}/cdn/;
}
location /spacedev/ {
rewrite /spacedev/(.*$) /$1 break;
root {{{nginx.fswww}}}spacedev/{{{nginx.website}}}/dist/;
}
location /api/ {
rewrite /api/(.*$) /$1 break;
proxy_pass http://localhost:{{{api.port}}};
proxy_redirect off;
include proxy_params;
}
#to add htpasswd install apache2-utils => sudo htpasswd -c dirtown/tribes/tribeId/.htpasswd loginname passwd see man for option
location / {
{{#nginx.private}}
auth_basic "Mot de passe {{nginx.privatelogin}}";
auth_basic_user_file {{dirtown}}/tribes/{{tribeId}}/.htpasswd;
{{/nginx.private}}
root {{{nginx.fswww}}}/{{{nginx.website}}};
index index.html {{{nginx.pageindex}}};
}
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;
}
}