28 lines
812 B
Plaintext
28 lines
812 B
Plaintext
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /var/www/html;
|
|
index index.php;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
# Gestion des fichiers PHP via PHP-FPM
|
|
location ~ \.php$ {
|
|
fastcgi_pass fpm-monip:9000; # Nom du service PHP-FPM dans docker-compose
|
|
fastcgi_index index.php;
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param REMOTE_ADDR $remote_addr;
|
|
fastcgi_param HTTP_X_REAL_IP $remote_addr;
|
|
fastcgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
# Cache des assets statiques
|
|
location ~* \.(css|js|png|jpg|jpeg|gif|ico)$ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, no-transform";
|
|
}
|
|
}
|