Skip to content

Instantly share code, notes, and snippets.

@cschar
Created March 30, 2017 13:16
Show Gist options
  • Save cschar/acb4b56eb6f4a885234ac50353d0d7da to your computer and use it in GitHub Desktop.
Save cschar/acb4b56eb6f4a885234ac50353d0d7da to your computer and use it in GitHub Desktop.
# sudo apt-get install:
# - php5
# - php5-cli
# - php5-curl
# - php5-gd
# - php5-imagick
# - php5-mysql
# - php5-xmlrpc
# - php5-xdebug
# - php5-fpm
# - apache2
# - libapache2-mod-php5
server {
listen 80;
listen [::]:80;
server_name {{ domain }} {{ domain_alias }};
underscores_in_headers on;
return 301 https://$host$request_uri;
}
server {
server_name {{ domain }} {{ domain_alias }};
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
listen 443 ssl;
ssl_session_cache shared:SSL:1m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
root /var/www/wordpress;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment