Rumah > Soal Jawab > teks badan
Saya pada asalnya menggunakan 8080
端口,但是今天将端口改成80
之后,浏览器可以直接打开localhost
,并且正确显示里面的目录,地址栏也显示localhost
。
之前搭建了一个wordpress本地博客,于是点击目录wordpress的目录,发现无法进入,地址栏显示localhost:8080/wordpress
,无论手动改成localhost/wordpress
还是localhost:80/wordpress
都会自动转到localhost:8080/wordpress
.
Telah disahkan bahawa ia tiada kaitan dengan cache penyemak imbas Saya telah cuba mengosongkan semua sejarah penyemakan imbas menggunakan Chrome dan Safari sebelum melawat semula, tetapi keadaannya tetap sama.
fail konfigurasi 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;
sendfile on;
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;
}