Demand:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/81/wKiom1SFIVXCUvg1AAGuMaUK6bI246.jpg "title=" qq.jpg "alt=" Wkiom1sfivxcuvg1aagumauk6bi246.jpg "/>
Modify the configuration file to jump:
server { listen 80; server_name shadouyou.com www.shadouyou.com; if ($host = ' Shadouyou.com ' ) { rewrite ^/(. *) $ http:// www.shadouyou.com/$1 permanent; } root /disk/var/www/ index; include /etc/nginx/conf.d/shadouyou-seo; location / { index index.html index.htm; &nbsP; proxy_set_header HOST $host; proxy_set_header X-Real-IP $remote _addr; proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for; if ( !-e $request _filename ) { proxy_pass http://index; } if ($request _uri ~* newsinfor.*) { rewrite ^ (. *) $ /404.html last ; } } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; }
When the client accesses www.shadouyou.com/newsinfor_XXXX.html, it is rewritten by the last if intercept to the 404.html location below to upload a 404 HTML file of its own in the root directory.
This article from "Loyalty" blog, declined reprint!
Nginx Specify 404 error page Jump