1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| server {
# Port d'écoute de nginx (dans ton cas 81)
listen 81;
root /var/www/;
index index.php index.html index.htm;
server_name tondomaine.com;
# Test si c'est un fichier php et l'envoi au proxy
location / {
try_files $uri $uri/ /index.php;
}
# définition du proxy
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080 #(Change par l'@ et port d'apache);
}
#Empêcher l'accès aux fichiers .htaccess
location ~ /\.ht {
deny all;
}
} |