Files
Phraseanet/docker/nginx/root/nginx.conf.sample
moctardiouf 026d61e52f PHRAS-4117 remove gateway /status and /ping page direct access (#4571)
* PHRAS-4117 remove gateway /status and /ping page direct access

* PHRAS-4117 fix typo

* PHRAS-4117 add ip management
2025-01-09 14:57:49 +01:00

83 lines
2.2 KiB
Plaintext

send_timeout $GATEWAY_SEND_TIMEOUT;
keepalive_timeout $GATEWAY_SEND_TIMEOUT;
proxy_connect_timeout $GATEWAY_PROXY_TIMEOUT;
proxy_send_timeout $GATEWAY_PROXY_TIMEOUT;
client_header_timeout $GATEWAY_SEND_TIMEOUT;
client_body_timeout $GATEWAY_SEND_TIMEOUT;
fastcgi_read_timeout $GATEWAY_FASTCGI_TIMEOUT;
resolver $NEW_RESOLVER;
upstream backend {
server phraseanet:9000;
}
#upstream samlsp {
# server phraseanet-saml-sp:8080;
#}
server {
listen 80;
root /var/alchemy/Phraseanet/www;
index index.php;
client_max_body_size $MAX_BODY_SIZE;
location /api {
if (-f /var/alchemy/Phraseanet/datas/nginx/maintenance.html) {
return 503;
}
rewrite ^(.*)$ /api.php/$1 last;
}
location / {
error_page 503 = @maintenance;
recursive_error_pages on;
if (-f /var/alchemy/Phraseanet/datas/nginx/maintenance.html) {
return 503;
}
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /index.php/$1 last;
}
# PHP scripts -> PHP-FPM server listening on 127.0.0.1:9000
location ~ ^/(index|index_dev|api)\.php(/|$) {
fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
$GATEWAY_FASTCGI_HTTPS
include restrictions;
}
location ~ ^/(status|ping)$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
include fastcgi_extended_params;
fastcgi_pass backend;
include status_allowed_ip;
deny all;
}
location /simplesaml/ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
set $target $NEW_TARGET:8080;
proxy_pass http://$target;
}
location @maintenance {
root /var/alchemy/Phraseanet/datas/nginx/;
try_files $uri /maintenance.html;
}
}