Skip to content

Instantly share code, notes, and snippets.

@jpalala
Last active August 29, 2015 14:00
Show Gist options
  • Save jpalala/934f4aac17f218d79748 to your computer and use it in GitHub Desktop.
Save jpalala/934f4aac17f218d79748 to your computer and use it in GitHub Desktop.
Eden-PHP Nginx Config
# will rewrite strip out www
server {
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
# statements for each of your virtual hosts to this file
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /server/public/example.com/web;
# autoindex on; not necessary if the next line is active
index index.php; # ensure only index.php
# hostname of server
server_name example.com;
location / {
try_files $uri $uri/ /index.php;
location = /index.php {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php; # tell fast cgi to run the index.php file. you can rename this. i guess i.e. web.php.
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
#error_page 404 /404.html;
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /var/www/halubilo.com;
#}
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/www;
#}
#for anything with php
# deny access to .htaccess files, if Apache root same as nginx
#location ~ /\.ht {
# deny all;
#}
}
HTTPS server
server {
listen 443;
server_name example.com;
root html;
index index.html index.htm;
ssl on;
ssl_certificate cert.pem;
ssl_certificate_key cert.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
ssl_prefer_server_ciphers on;
location / {
try_files $uri $uri/ =404;
}
}
@jpalala
Copy link
Author

jpalala commented Sep 13, 2014

Tested on Debian 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment