67 lines
1.7 KiB
Plaintext
67 lines
1.7 KiB
Plaintext
server {
|
|
|
|
listen 80;
|
|
server_name localhost;
|
|
root /twake-core/web;
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000";
|
|
|
|
location / {
|
|
return 302 https://web.twake.app/;
|
|
}
|
|
|
|
location ~ ^/(internal|plugins).* {
|
|
proxy_pass http://node:3000;
|
|
}
|
|
|
|
location ~ ^/(api|administration)/v2/.* {
|
|
proxy_pass http://node:3000;
|
|
}
|
|
|
|
location ~ ^/socket/.* {
|
|
proxy_pass http://node:3000;
|
|
# this magic is needed for WebSocket
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_connect_timeout 7d;
|
|
proxy_send_timeout 7d;
|
|
proxy_read_timeout 7d;
|
|
}
|
|
|
|
location ~ ^/(ajax|api|administration|upload|bundle|medias).* {
|
|
# try to serve file directly, fallback to rewrite
|
|
try_files $uri @rewriteapp;
|
|
}
|
|
|
|
location @rewriteapp {
|
|
# rewrite all to app.php
|
|
rewrite ^(.*)$ /app.php/$1 last;
|
|
}
|
|
|
|
location ~ /.well-known {
|
|
allow all;
|
|
}
|
|
|
|
location ~ ^/(app|app_dev|config|dev\/.*)\.php(/|$) {
|
|
fastcgi_pass php-upstream;
|
|
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param HTTPS off;
|
|
fastcgi_buffer_size 128k;
|
|
fastcgi_buffers 4 256k;
|
|
fastcgi_busy_buffers_size 256k;
|
|
}
|
|
|
|
location ~ /.well-known {
|
|
allow all;
|
|
}
|
|
|
|
error_log /var/log/nginx/twakeapp_dev_error.log;
|
|
access_log /var/log/nginx/twakeapp_dev_access.log;
|
|
|
|
}
|