Skip to content

Instantly share code, notes, and snippets.

@adriandmitroca
Created May 16, 2016 12:37
Show Gist options
  • Save adriandmitroca/d15db8044bb968301a88b230b08e1107 to your computer and use it in GitHub Desktop.
Save adriandmitroca/d15db8044bb968301a88b230b08e1107 to your computer and use it in GitHub Desktop.
nginx example configuration with OPCache's workaround
server {
listen 80;
listen 443 ssl http2;
server_name example.com www.example.com;
root /home/deploy/example.com/current/public;
error_log /home/deploy/example.com/logs/error.log;
access_log /home/deploy/example.com/logs/access.log;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment