问题描述
我原本在用8080端口,但是今天将端口改成80之后,浏览器可以直接打开localhost,并且正确显示里面的目录,地址栏也显示localhost。之前搭建了一个wordpress本地博客,于是点击目录wordpress的目录,发现无法进入,地址栏显示localhost:8080/wordpress,无论手动改成localhost/wordpress还是localhost:80/wordpress都会自动转到localhost:8080/wordpress。
已经确定和浏览器缓存无关,试过用chrome和safari清理所有浏览记录后再访问,情况依旧。
nginx配置文件
worker_processes 1;error_log /usr/local/var/log/nginx/error.log debug;pid/usr/local/var/run/nginx.pid;events { worker_connections 256;}http { include mime.types; default_type application/octet-stream; log_format main ’$remote_addr - $remote_user [$time_local] '$request' ’ ’$status $body_bytes_sent '$http_referer' ’ ’'$http_user_agent' '$http_x_forwarded_for'’; access_log /usr/local/var/log/nginx/access.log main; sendfileon; keepalive_timeout 65; server {listen 80;server_name localhost;try_files $uri $uri/ /index.php$uri /index.php?$args;root /usr/local/var/www;location / { root /usr/local/var/www; index index.php index.html index.htm; #try_files $uri $uri/ /index.php$uri; #try_files $uri $uri/ /index.html; try_files $uri $uri/ =404; fastcgi_param script_filename $document_root$fastcgi_script_name;}include php.conf; //这个是PHP的配置文件,应该不用了吧…… } include servers/*; include /usr/local/etc/nginx/sites-enabled/*; autoindex on; autoindex_exact_size off;}
问题解答
回答1:请贴上你的配置