nginx 301 跳转配置

server {
        listen       80;
        server_name xxx.com;
        index index.php index.html index.shtml index.htm;
        root /eetop/nginx/out_hibeauty;
        return 301 http://test.com;

        location / {
        try_files $uri $uri/ /index.php?$args;
        }

        location ~ .*\.(php)?$
        {
        expires -1s;
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass 127.0.0.1:9000;
        #fastcgi_pass unix:/var/run/phpfpm.sock;
        #php-fpm.conf listen = /var/run/phpfpm.sock##
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   out_hibeauty;
        }
    }

猜你喜欢

转载自lunzi.iteye.com/blog/2200670