modif setup
This commit is contained in:
42
setup/conf/nginx/nginx.conf.mustache
Executable file
42
setup/conf/nginx/nginx.conf.mustache
Executable file
@@ -0,0 +1,42 @@
|
||||
user {{{sudoerUser}}};
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
#include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections {{nginx.worker_connections}};
|
||||
}
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$time_iso8601###$status###$request';
|
||||
|
||||
log_format tracker escape=json
|
||||
'{"time":"$time_iso8601","alias":"$arg_alias","uuid":"$arg_uuid",'
|
||||
'"lg":"$arg_lg","consentcookie":"$arg_consentcookie","version":"$arg_version",'
|
||||
'"srckey":"$arg_srckey","request_filename":"$request_filename",'
|
||||
'"remoteaddr":"$remote_addr","httpxforwardedfor":"$http_x_forwarded_for",'
|
||||
'"httpreferer":"$http_referer","httpuseragent":"$http_user_agent","request":"$request"}';
|
||||
|
||||
log_format mainold '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_buffers 4 32k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/x-font-ttf application/javascript font/eot font/opentype image/svg+xml image/x-icon text/plain;
|
||||
|
||||
##
|
||||
# Virtual Host Configs
|
||||
##
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /home/{{sudoerUser}}/apxtowns/{{townId}}-{{nationId}}/conf/nginx/*.conf;
|
||||
}
|
81
setup/conf/nginx/nginxmodelwebsite.conf.mustache
Executable file
81
setup/conf/nginx/nginxmodelwebsite.conf.mustache
Executable file
@@ -0,0 +1,81 @@
|
||||
server {
|
||||
server_name {{#dns}} {{.}} {{/dns}};
|
||||
access_log {{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/log/nginx/{{tribeId}}_{{website}}.access.log main;
|
||||
|
||||
set $trackme 0;
|
||||
if ( $uri ~ ^/trk/ ){
|
||||
set $trackme 1;
|
||||
}
|
||||
access_log {{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/log/nginx/{{tribeId}}_{{website}}.trk.log tracker if=$trackme ;
|
||||
location ~* /trk/ {
|
||||
if ( $uri ~ ^/trk/redirect ){
|
||||
return 301 $arg_url;
|
||||
}
|
||||
rewrite ^/trk/(.*)$ /$1;
|
||||
}
|
||||
|
||||
location /Checkjson.js {
|
||||
alias {{foldertowns}}/{{townId}}-{{nationId}}/apxtri/models/Checkjson.js;
|
||||
}
|
||||
location ~* /nationchains/(blocks|pagans|towns|nations)/ {
|
||||
# Warning: never add tribes for keeping it private
|
||||
root {{foldertowns}}/{{townId}}-{{nationId}}/nationchains/;
|
||||
}
|
||||
location ~* /nationchains/models/ {
|
||||
rewrite /nationchains/models/(.*$) /$1 break;
|
||||
root {{foldertowns}}/{{townId}}-{{nationId}}/apxtri/models/lg/;
|
||||
}
|
||||
location ~* /nationchains/schema/ {
|
||||
#outside of nationchains for git purpose
|
||||
rewrite /nationchains/schema/(.*$) /$1 break;
|
||||
root {{{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/adminapi/schema/;
|
||||
}
|
||||
location ~* /{{tribeId}}/schema/{
|
||||
rewrite /{{tribeId}}/schema/(.*$) /$1 break;
|
||||
root {{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/{{tribeId}}/schema/;
|
||||
}
|
||||
|
||||
location ~* /{{tribeId}}/models/{
|
||||
rewrite /{{tribeId}}/models/(.*$) /$1 break;
|
||||
root {{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/{{tribeId}}/api/models/lg/;
|
||||
}
|
||||
|
||||
location /cdn/ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public";
|
||||
rewrite /cdn/(.*$) /$1 break;
|
||||
root {{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/{{tribeId}}/www//cdn/;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
rewrite /api/(.*$) /$1 break;
|
||||
proxy_pass http://localhost:{{{api.port}}};
|
||||
proxy_redirect off;
|
||||
include proxy_params;
|
||||
}
|
||||
|
||||
location /apxwebapp/ {
|
||||
rewrite /apxwebapp/(.*$) /$1 break;
|
||||
root {{foldertowns}}/apxwebapp/;
|
||||
index index.html index_en.html;
|
||||
}
|
||||
|
||||
#to add htpasswd install apache2-utils => sudo htpasswd -c dirtown/tribes/tribeId/.htpasswd loginname passwd see man for
|
||||
option
|
||||
|
||||
location / {
|
||||
{{#private}}
|
||||
auth_basic "Mot de passe {{privatelogin}}";
|
||||
auth_basic_user_file {{{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/{{tribeId}}/.htpasswd;
|
||||
{{/private}}
|
||||
root {{foldertowns}}/{{townId}}-{{nationId}}/nationchains/tribes/{{tribeId}}/www/{{{website}}};
|
||||
index index.html {{{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;
|
||||
}
|
||||
}
|
11
setup/conf/nginx/nginxproxyparams.mustache
Normal file
11
setup/conf/nginx/nginxproxyparams.mustache
Normal file
@@ -0,0 +1,11 @@
|
||||
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;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 10m;
|
||||
client_body_buffer_size 128k;
|
||||
proxy_connect_timeout 90;
|
||||
proxy_send_timeout 90;
|
||||
proxy_read_timeout 90;
|
||||
proxy_buffers 32 4k;
|
||||
proxy_set_header X-NginX-Proxy true;
|
Reference in New Issue
Block a user