Last active
August 29, 2015 14:03
-
-
Save matteosister/17c1ec8bc2b391ae5def to your computer and use it in GitHub Desktop.
nginx conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name www.hostname.com; | |
root /var/www/hostname/current/web; | |
listen 81 default_server; | |
error_log /var/log/nginx/error.log; | |
access_log /var/log/nginx/access.log; | |
rewrite ^/app\.php/?(.*)$ /$1 permanent; | |
location /health_check { | |
return 200 'check!'; | |
add_header Content-Type text/plain; | |
} | |
location / { | |
index app.php; | |
# prova a servire direttamente i file, fallback su riscrittura | |
try_files $uri @rewrite; | |
} | |
location @rewrite { | |
# riscrittura di tutto su app.php | |
rewrite ^(.*)$ /app.php/$1 last; | |
} | |
location ~ ^/(app|info|opcache_clear)\.php(/|$) { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param HTTPS off; | |
auth_basic "Restricted"; | |
auth_basic_user_file /home/ubuntu/.htpasswd; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment