Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # You may add here your
- # server {
- # ...
- # }
- # statements for each of your virtual hosts to this file
- ##
- # You should look at the following URL's in order to grasp a solid understanding
- # of Nginx configuration files in order to fully unleash the power of Nginx.
- # http://wiki.nginx.org/Pitfalls
- # http://wiki.nginx.org/QuickStart
- # http://wiki.nginx.org/Configuration
- #
- # Generally, you will want to move this file somewhere, and start with a clean
- # file but keep this around for reference. Or just disable in sites-enabled.
- #
- # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
- ##
- server {
- server_name www.example.com;
- return 301 $scheme://example.com$request_uri;
- }
- server {
- listen 80;
- root /usr/share/nginx/www/example;
- index index.php;
- server_name example.com;
- access_log /var/log/nginx/example.access.log;
- error_log /var/log/nginx/example.error.log;
- error_page 404 /index.php;
- location / {
- try_files $uri $uri/ @wordpress;
- }
- # enforce NO www
- #if ($host ~* ^www\.(.*)) {
- # set $host_without_www $1;
- # rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
- #}
- if (!-e $request_filename) {
- rewrite ^(.+)$ /index.php?q=$1 last;
- }
- location @wordpress {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_param SCRIPT_FILENAME /usr/share/nginx/www/example/index.php;
- include /etc/nginx/fastcgi_params;
- fastcgi_param SCRIPT_NAME /index.php;
- }
- location ~ \.php$ {
- try_files $uri @wordpress;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
- # With php5-cgi alone:
- fastcgi_pass 127.0.0.1:9000;
- # With php5-fpm:
- # fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- }
- location /phpmyadmin {
- root /usr/share/;
- index index.php index.html index.htm;
- location ~ ^/phpmyadmin/(.+\.php)$ {
- try_files $uri =404;
- root /usr/share/;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include /etc/nginx/fastcgi_params;
- }
- location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
- root /usr/share/;
- }
- }
- location /phpMyAdmin {
- rewrite ^/* /phpmyadmin last;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- #location ~ /\.ht {
- # deny all;
- #}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement