mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
111 lines
3.3 KiB
Plaintext
111 lines
3.3 KiB
Plaintext
server {
|
|
server_name $NGINX_SERVER_NAME;
|
|
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
include /etc/nginx/common/protect.conf;
|
|
include /etc/nginx/common/protect_add_header.conf;
|
|
|
|
#gzip_static on;
|
|
gzip on;
|
|
gzip_proxied any;
|
|
gzip_types
|
|
text/css
|
|
text/javascript
|
|
text/xml
|
|
text/plain
|
|
application/javascript
|
|
application/x-javascript
|
|
application/json;
|
|
|
|
# Legacy URLS
|
|
set $REWRITE_LEGACY_URLS "$NGINX_REWRITE_LEGACY_URLS";
|
|
if ($REWRITE_LEGACY_URLS = 'true') {
|
|
rewrite ^/vue/?(.*)$ /$1 permanent;
|
|
}
|
|
|
|
# Frontend (default)
|
|
location / {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_redirect off;
|
|
|
|
access_log $GRADIDO_LOG_PATH/nginx-access.frontend.log gradido_log;
|
|
error_log $GRADIDO_LOG_PATH/nginx-error.frontend.log warn;
|
|
}
|
|
|
|
# Backend
|
|
location /graphql {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_pass http://127.0.0.1:4000;
|
|
proxy_redirect off;
|
|
|
|
access_log $GRADIDO_LOG_PATH/nginx-access.backend.log gradido_log;
|
|
error_log $GRADIDO_LOG_PATH/nginx-error.backend.log warn;
|
|
}
|
|
|
|
# Backend webhooks
|
|
location /hook {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Host $host;
|
|
|
|
# no trailing slash to keep the hook/ prefix
|
|
proxy_pass http://127.0.0.1:4000/hook;
|
|
proxy_redirect off;
|
|
|
|
access_log $GRADIDO_LOG_PATH/nginx-access.backend.hook.log gradido_log;
|
|
error_log $GRADIDO_LOG_PATH/nginx-error.backend.hook.log warn;
|
|
}
|
|
|
|
# Webhook reverse proxy
|
|
location /hooks/ {
|
|
proxy_pass http://127.0.0.1:9000/hooks/;
|
|
|
|
access_log $GRADIDO_LOG_PATH/nginx-access.hooks.log gradido_log;
|
|
error_log $GRADIDO_LOG_PATH/nginx-error.hooks.log warn;
|
|
}
|
|
|
|
# Admin Frontend
|
|
location /admin {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_pass http://127.0.0.1:8080/;
|
|
proxy_redirect off;
|
|
|
|
access_log $GRADIDO_LOG_PATH/nginx-access.admin.log gradido_log;
|
|
error_log $GRADIDO_LOG_PATH/nginx-error.admin.log warn;
|
|
}
|
|
|
|
# TODO this could be a performance optimization
|
|
#location /vue {
|
|
# alias /var/www/html/gradido/frontend/dist;
|
|
# index index.html;
|
|
#
|
|
# location ~* \.(png)$ {
|
|
# expires 39d;
|
|
# }
|
|
# try_files $uri $uri/ /index.html = 404;
|
|
#}
|
|
} |