rewrite or return directives for discuz v3.1

r004 nginx-forum at nginx.us
Wed Dec 4 07:54:30 UTC 2013


hello;
I want to write a block to put in my VHOST config file.
i want
1. if there is "/install/index.php/" in the link. it shouldbe removed from
the link.
2. if the format is like  /uc_server/blab.php/uc_server/blahblah ===it
should change to===>/uc_server/blabal

what should I put in my VHOST config file and where?




my current VHOST format is :
[CODE]
server {
    server_name  www.DOMAINNAME;
    rewrite ^(.*) http://DOMAINNAME$1 permanent;
}
 
server {
        listen 80;
        server_name DOMAINNAME;
                root   /var/www/DOMAINNAME/htdocs;
                index index.php;
		include /etc/nginx/security;
 
# Logging --
access_log  /var/log/nginx/DOMAINNAME.access.log;
error_log  /var/log/nginx/DOMAINNAME.error.log notice;
 
        # serve static files directly
        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
            access_log        off;
            expires           max;
        }
 
        location ~ \.php$ {
		try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm/DOMAINNAME.socket;
                fastcgi_index index.php;
                include /etc/nginx/fastcgi_params;
        }
}
[/CODE]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,245192,245192#msg-245192



More information about the nginx mailing list