Skip to content

Instantly share code, notes, and snippets.

@JaniKibichi
Created January 7, 2017 09:53
Show Gist options
  • Save JaniKibichi/fcc940c3a122c9622166822661133c45 to your computer and use it in GitHub Desktop.
Save JaniKibichi/fcc940c3a122c9622166822661133c45 to your computer and use it in GitHub Desktop.
Nginx Config with HHVM
#Start of server blocks
# HTTP - redirect all requests to HTTPS:
server {
listen 80;
#listen [::]:80 default_server ipv6only=on;
server_name another.com;
return 301 https://$server_name$request_uri;
}
# HTTPS - proxy requests on to local Node.js app:
server {
listen 443;
server_name another.com;
ssl on;
# Use certificate and key provided by Let's Encrypt:
ssl_certificate /etc/letsencrypt/live/another.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/another.com/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
root /var/www/html/wordpress;
include hhvm.conf;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
location ~ /favicon.ico {
access_log off;
log_not_found off;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php7.0-fpm:
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
access_log /var/log/nginx/$host-access.log;
error_log /var/log/nginx/wordpress-error.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment