Sie sind auf Seite 1von 3

server { listen listen ssl_certificate ssl_certificate_key 80; 443 ssl; /etc/ssl/certs/ssl-cert-snakeoil.pem; /etc/ssl/private/ssl-cert-snakeoil.

key;

server_name dev.btranslator.org l10n-dev.org.al; root /var/www-ssl/dev.btranslator.org; access_log /var/log/nginx/btranslator_dev.access.log; error_log /var/log/nginx/btranslator_dev.error.log info; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } # This matters if you use drush location = /backup { deny all; } # Very rarely should these ever be accessed outside of your lan location ~* \.(txt|log)$ { allow 127.0.0.1; deny all; } # This location block protects against a known attack. location ~ \..*/.*\.php$ { return 403; } # This is our primary location block. location / { index index.php;

try_files $uri $uri/ @rewrite; expires max; } # This will rewrite our request from domain.com/node/1/ to domain.com/index.php?q=node/1 # This could be done in try_files without a rewrite however, the GlobalRedirect # module enforces no slash (/) at the end of URL's. This rewrite removes that # so no infinite redirect loop is reached. location @rewrite { rewrite ^/(.*)$ /index.php?q=$1; } # If a PHP file is served, this block will handle the request. This block # works on the assumption you are using php-cgi listening on /tmp/phpcgi.socket. # Please see the php example (usr/share/doc/nginx/exmaples/php) for more # information about setting up PHP. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; # Intercepting errors will cause PHP errors to appear in Nginx logs fastcgi_intercept_errors on; fastcgi_pass unix:/var/run/php-fpm.sock; } # The ImageCache module builds an image 'on the fly' which means that # if it doesn't exist, it needs to be created. Nginx is king of static # so there's no point in letting PHP decide if it needs to be servered # # # # # # from an existing file. If the image can't be served directly, it's assumed that it doesn't exist and is passed off to PHP via our previous rewrite to let PHP create and serve the image. Notice that try_files does not have $uri/ in it. This is because an image should never be a directory. So there's no point in wasting a

# stat to serve it that way. location ~ ^/sites/.*/files/imagecache/ { try_files $uri @rewrite; } # As mentioned above, Nginx is king of static. If we're serving a static # file that ends with one of the following extensions, it is best to set # a very high expires time. This will generate fewer requests for the # file. These requests will be logged if found, but not if they don't # exist. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } # Configuration for phpMyAdmin location /phpmyadmin { root /usr/share/; index index.php index.html index.htm; location ~ ^/phpmyadmin/(.+\.php)$ { try_files $uri =404; root /usr/share/; fastcgi_pass unix:/var/run/php-fpm.sock; 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; } }

Das könnte Ihnen auch gefallen