nginx-server-from-git/nginx-php.conf
Emmy D'Anello e8454e2922
Use real IP from forwarded IP
Signed-off-by: Emmy D'Anello <emmy@luemy.eu>
2025-02-26 00:07:47 +01:00

47 lines
1.1 KiB
Plaintext

upstream trigger-ci {
server 127.0.0.1:8555;
}
server {
listen 80;
server_name static-server;
root /var/www/html;
index index.html index.htm index.php;
error_page 404 /404.html;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 0.0.0.0/0;
location /trigger-ci.json {
proxy_pass http://trigger-ci;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
location /.git* {
return 404;
}
location /README* {
return 404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}