Skip to content

Instantly share code, notes, and snippets.

@alexander-ae
Created December 23, 2016 17:17
Show Gist options
  • Save alexander-ae/22d4e1705e09d29c4c99043ff1766dc1 to your computer and use it in GitHub Desktop.
Save alexander-ae/22d4e1705e09d29c4c99043ff1766dc1 to your computer and use it in GitHub Desktop.
Nginx: symfony + wordpress
server {
listen 80 default_server;
root /var/www/html/proyecto/web;
index index.php index.html index.htm index.nginx-debian.html;
location /blog {
try_files $uri $uri/ @wordpress;
}
location @wordpress {
rewrite /blog/ /blog/index.php;
}
location ^/blog/index.php(/.*)?$ {
fastcgi_split_path_info ^(/blog/index.php)(/.*)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
#autoindex on;
#try_files $uri $uri/ =404;
try_files $uri /app.php$is_args$args;
}
location ~ ^/app\.php(/|$) {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment