Created
November 29, 2012 14:04
-
-
Save cherifya/4169291 to your computer and use it in GitHub Desktop.
Wordpress site config for nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server{ | |
| listen 80; #or change this to your public IP address eg 1.1.1.1:80 | |
| server_name wordpress; #change this to the domain name, for example www.myblog.com | |
| access_log /var/log/wordpress.access_log; | |
| error_log /var/log/wordpress.error_log; | |
| location / { | |
| root /home/your-user-name/Sites/wordpress; | |
| index index.php index.html index.htm; | |
| # this serves static files that exist without running other rewrite tests | |
| if (-f $request_filename) { | |
| expires 30d; | |
| break; | |
| } | |
| # this sends all non-existing file or directory requests to index.php | |
| if (!-e $request_filename) { | |
| rewrite ^(.+)$ /index.php?q=$1 last; | |
| } | |
| } | |
| location ~ \.php$ { | |
| fastcgi_pass 127.0.0.1:9000; | |
| fastcgi_index index.php; | |
| fastcgi_param SCRIPT_FILENAME /home/your-user-name/Sites/wordpress$fastcgi_script_name; | |
| include fastcgi_params; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment