We recommend using:
Setting up nginx
Nginx configuration example (together with php-fpm)
upstream phpfpm {
server 127.0.0.1:9000; # php-fpm listens to tcp/9000
# server unix:/tmp/fastcgi.socket; # php-fpm listens to a unix socket
}
server {
# listen 80;
# real_ip_header X-Real-IP;
# set_real_ip_from 192.168.1.1;
# server_name online.happy.travel;
# root /srv/www/tourcompile/;
# client_max_body_size 8m;
default_type text/plain;
location ~ /.svn/ { deny all;}
location ~ /.git/ { deny all;}
location ~ \.htaccess { deny all; }
location ~ /tmp { deny all; }
location ~ \.tpl { deny all; }
location ~ \.fpdf { deny all; }
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_param HTTP_PROXY ""; # Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass phpfpm;
}
location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|rar|doc|xls|js|xml|pdf) {
expires max;
}
location/{
# rewrite ^/$ /search_tour redirect;
index default.php index.php;
if (!-e $request_filename) {
rewrite ^/(.+)$ /default.php?page=$1&$query_string last;
break;
}
if ( -f $request_filename ) {
expires 10d;
}
}
}
Setting up php