Skip to content

Instantly share code, notes, and snippets.

@matteosister
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matteosister/17c1ec8bc2b391ae5def to your computer and use it in GitHub Desktop.
Save matteosister/17c1ec8bc2b391ae5def to your computer and use it in GitHub Desktop.
nginx conf
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