mirror of
https://github.com/sergeyyarkov/astro-directus-example.git
synced 2026-10-11 02:08:57 +03:00
84 lines
2.2 KiB
Nginx Configuration File
84 lines
2.2 KiB
Nginx Configuration File
user nginx;
|
|
worker_processes auto;
|
|
|
|
error_log /var/log/nginx/error.log notice;
|
|
pid /var/run/nginx.pid;
|
|
|
|
events { worker_connections 1024; }
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
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;
|
|
|
|
sendfile on;
|
|
#tcp_nopush on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
server_tokens off;
|
|
|
|
resolver 127.0.0.11 valid=30s ipv6=off;
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
server_name localhost;
|
|
|
|
location / {
|
|
set $website http://web:80;
|
|
proxy_pass $website;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
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 /webhooks {
|
|
rewrite ^/webhooks/(.*)$ /$1 break;
|
|
proxy_pass http://host.docker.internal:8080;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
|
proxy_set_header Host $http_host;
|
|
proxy_redirect off;
|
|
proxy_buffering off;
|
|
chunked_transfer_encoding off;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
client_max_body_size 100M;
|
|
|
|
server_name cms.localhost;
|
|
|
|
location / {
|
|
proxy_pass http://directus:8055;
|
|
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 REMOTE-HOST $remote_addr;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_read_timeout 86400s;
|
|
proxy_send_timeout 30s;
|
|
proxy_http_version 1.1;
|
|
|
|
add_header X-Cache $upstream_cache_status;
|
|
}
|
|
}
|
|
} |