forked from eatvio/eatvio-infra
141 lines
3.7 KiB
Nginx Configuration File
141 lines
3.7 KiB
Nginx Configuration File
upstream phpupstream {
|
|
server php-fpm:9000 fail_timeout=5s max_fails=5;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name shalom.eatvio.local;
|
|
|
|
client_max_body_size 108M;
|
|
|
|
# access_log /var/log/nginx/application.access.log;
|
|
|
|
access_log /dev/stdout;
|
|
|
|
root /application/public;
|
|
index index.php;
|
|
|
|
# try to serve file directly, fallback to index.php
|
|
location / {
|
|
try_files $uri /index.php$is_args$args;
|
|
}
|
|
|
|
if (!-e $request_filename) {
|
|
rewrite ^.*$ /index.php last;
|
|
}
|
|
|
|
|
|
location ~ \.php$ {
|
|
#resolver 127.0.0.11;
|
|
#set $upstream php-fpm:9000;
|
|
#fastcgi_pass php-fpm:9000;
|
|
# nginx will now start if host is not reachable
|
|
fastcgi_pass phpupstream;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
|
|
fastcgi_buffers 16 16k;
|
|
fastcgi_buffer_size 32k;
|
|
include fastcgi_params;
|
|
}
|
|
}
|
|
server {
|
|
listen 5000 ssl;
|
|
server_name localhost;
|
|
|
|
ssl_certificate /etc/nginx/shalom.eatvio.local+2.pem;
|
|
ssl_certificate_key /etc/nginx/shalom.eatvio.local+2-key.pem;
|
|
ssl_protocols TLSv1.2;
|
|
rewrite_log on;
|
|
error_log /dev/stdout debug;
|
|
|
|
charset UTF-8;
|
|
|
|
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-Host $server_name;
|
|
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
# add_header Content-Security-Policy "default-src 'self';";
|
|
|
|
|
|
server_tokens off;
|
|
client_max_body_size 100M;
|
|
root /application/public;
|
|
index index.php;
|
|
|
|
# location ^~ /visualization/ {
|
|
# rewrite /visualization/(.*) /$1 break;
|
|
# proxy_pass http://imageproxy:8080;
|
|
# }
|
|
|
|
# try to serve file directly, fallback to index.php
|
|
location / {
|
|
try_files $uri /index.php$is_args$args;
|
|
}
|
|
|
|
# if (!-e $request_filename) {
|
|
# rewrite ^.*$ /index.php last;
|
|
# }
|
|
|
|
location ~ \.php$ {
|
|
fastcgi_pass phpupstream;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
|
|
fastcgi_buffers 16 16k;
|
|
fastcgi_buffer_size 32k;
|
|
include fastcgi_params;
|
|
}
|
|
}
|
|
server {
|
|
listen 5000 ssl;
|
|
server_name socket.shalom.eatvio.local;
|
|
|
|
ssl_certificate /etc/nginx/shalom.eatvio.local+2.pem;
|
|
ssl_certificate_key /etc/nginx/shalom.eatvio.local+2-key.pem;
|
|
ssl_protocols TLSv1.2;
|
|
|
|
location / {
|
|
proxy_pass http://soketi:6001;
|
|
proxy_read_timeout 60;
|
|
proxy_connect_timeout 60;
|
|
proxy_redirect off;
|
|
|
|
# Allow the use of websockets
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
}
|
|
|
|
error_log /dev/stdout info;
|
|
access_log /dev/stdout;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name socket.shalom.eatvio.local;
|
|
|
|
location / {
|
|
proxy_pass http://soketi:6001;
|
|
proxy_read_timeout 60;
|
|
proxy_connect_timeout 60;
|
|
proxy_redirect off;
|
|
|
|
# Allow the use of websockets
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
}
|
|
|
|
error_log /dev/stdout info;
|
|
access_log /dev/stdout;
|
|
}
|