Skip to content

Instantly share code, notes, and snippets.

@0xjams
Last active March 12, 2016 18:32
Show Gist options
  • Save 0xjams/4278c864be197fd4565c to your computer and use it in GitHub Desktop.
Save 0xjams/4278c864be197fd4565c to your computer and use it in GitHub Desktop.
Nginx server configuration for silex
server {
listen 80;
server_name empleo.localhost;
root html/empleo/web;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
try_files $uri /index.php$is_args$args;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# If you have 2 front controllers for dev|prod use the following line instead
# location ~ ^/(index|index_dev)\.php(/|$) {
location ~ ^/index\.php(/|$) {
# the ubuntu default
fastcgi_pass 127.0.0.1:9000;
# for running on centos
#fastcgi_pass unix:/var/run/php-fpm/www.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/index.php/some-path
# Enable the internal directive to disable URIs like this
# internal;
}
location ~ \.php$ {
return 404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment