84 lines
2.2 KiB
Nginx Configuration File
84 lines
2.2 KiB
Nginx Configuration File
# Example for conf.d/default.conf
|
|
user www-data;
|
|
worker_processes 1;
|
|
|
|
error_log /var/log/nginx/error.log;
|
|
pid /var/run/nginx.pid;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
|
|
upstream notenextra-math {
|
|
server notenextra-math:4200;
|
|
}
|
|
|
|
upstream notenextra-cse {
|
|
server notenextra-cse:4200;
|
|
}
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
# add extra types
|
|
|
|
types {
|
|
text/javascript mjs;
|
|
}
|
|
|
|
default_type application/octet-stream;
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
rewrite ^/.well-known/carddav /remote.php/dav/ permanent;
|
|
rewrite ^/.well-known/caldav /remote.php/dav/ permanent;
|
|
|
|
location = /robots.txt {
|
|
allow all;
|
|
log_not_found off;
|
|
access_log off;
|
|
}
|
|
|
|
location ~ ^/(build|tests|config|lib|3rdparty|templates|data)/ {
|
|
deny all;
|
|
}
|
|
|
|
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) {
|
|
deny all;
|
|
}
|
|
|
|
location ~ ^/Math(.*)$ {
|
|
proxy_pass http://notenextra-math/$1;
|
|
proxy_set_header Host $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;
|
|
}
|
|
|
|
location ~ ^/CSE(.*)$ {
|
|
proxy_pass http://notenextra-cse/$1;
|
|
proxy_set_header Host $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;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://notenextra-cse;
|
|
proxy_set_header Host $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;
|
|
}
|
|
|
|
}
|
|
} |