小编use*_*401的帖子

Nginx 使用域名时返回 404 not found 错误

我在使用 nginx 时遇到问题,其中我的 ip 地址指向我的网站,但是当我将我的域指向该 ip 地址,并尝试使用我的域名 (www.example.com) 访问我的 webstie 时,nginx 返回 404 错误。这是我的代码。

user www-data;
worker_processes 4;
worker_rlimit_nofile 100000;
pid /run/nginx.pid;

events {
use epoll;
worker_connections 1024;
multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
keepalive_requests 200;
reset_timedout_connection on;   
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

#gzip …
Run Code Online (Sandbox Code Playgroud)

php nginx

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

nginx ×1

php ×1