location ~ \.php$ {
try_files $uri index.php;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
GET /admin/headers HTTP/1.1" 404 571 "http://mysite.cloudapp.net/admin/"
<IfModule mod_rewrite.c>
RewriteEngine On
# we skip all files with .something
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteRule .* - [L]
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
server {
set $website_host "mysite.cloudapp.net";
set $website_root "/var/www/mysite/web";
set $default_controller "index.php";
set $symfony_root "/var/www/mysite/lib/symfony";
listen 80;
server_name $website_host;
merge_slashes on;
# Gzip
gzip on;
gzip_min_length 1000;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6]\.";
access_log /var/log/nginx/access.log;
root $website_root;
index $default_controller;
charset utf-8;
location / {
try_files $uri $uri/ /$default_controller;
}
location /sf {
alias $symfony_root/data/web/sf;
expires max;
}
location /admin {
allow 192.168.0.0/24;
deny all;
}
location ~ \.php$ {
try_files $uri index.php;
set $script $uri;
set $path_info $2;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $website_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico|mp3|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|dat|avi|ppt|txt|tar|mid|midi|wav|bmp|rtf|wmv|mpeg|mpg|tbz|js)$ {
expires max;
valid_referers none blocked server_names
~\.google\. images\.yandex\. ~\.yandex\. $website_host;
if ($invalid_referer) {return 444;}
log_not_found off;
error_page 404 = /404/;
}
}
server {
set $website_host "mysite.cloudapp.net";
set $website_root "/var/www/mysite/web";
set $default_controller "index.php";
set $symfony_root "/var/www/mysite/lib/symfony";
listen 80;
server_name $website_host;
merge_slashes on;
# Gzip
gzip on;
gzip_min_length 1000;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_disable "MSIE [1-6]\.";
access_log /var/log/nginx/$website_host.access.log;
root $website_root;
index $default_controller;
charset utf-8;
location / {
try_files $uri $uri/ /$default_controller;
}
location /sf {
# path to folder where all symfony assets are located
alias /var/www/mysite/web/sf/;
expires max;
}
location /admin {
allow 192.168.0.0/24;
deny all;
}
location ~ \.php$ {
try_files $uri index.php;
set $script $uri;
set $path_info "/";
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $website_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
}
### static files
location ~* ^.+\.(jpg|jpeg|gif|png|ico|mp3|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|dat|avi|ppt|txt|tar|mid|midi|wav|bmp|rtf|wmv|mpeg|mpg|tbz|js)$ {
expires max;
valid_referers none blocked server_names
~\.google\. images\.yandex\. ~\.yandex\. ;
if ($invalid_referer) {return 444;}
log_not_found off;
error_page 404 = /404/;
}
}
Плюс у него есть интеграция с Exchange, так что можно заменить внешний линуксовый гейт на Edge Transport с Kaspersky.