公司测试环境,某网站图片加载不了
nginx 配置
server { listen 80; listen 443 ssl; charset utf-8; root /var/www/html/ad-server; index index.html index.htm index.php redirect.php; access_log /var/www/html/log/access_ad.log; error_log /var/www/html/log/error_ad.log; server_name test.gadmobe.com; ssl on; ssl_certificate /usr/local/nginx/conf/sslkey/test.gadmobe.com.crt; ssl_certificate_key /usr/local/nginx/conf/sslkey/test.gadmobe.com.key; error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location / { fastcgi_pass phpbackend; try_files $uri $uri/ /index.php?$args; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location /subscription { fastcgi_pass phpbackend; rewrite ^(.*) /push/save_info.php last; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; set $pinpoint_proxy_header " t=$msec D=$request_time"; fastcgi_param Pinpoint-ProxyNginx $pinpoint_proxy_header; include fastcgi_params; } }
解决
#在最后加入这段配置: location ~* \.(gif|jpg|jpeg|png|css|js|ico)$ { root /var/www/html/ad-server;}#让配置生效/usr/local/nginx/sbin/nginx -s reload
这就解决啦