gpt4 book ai didi

Nginx 在初始安装后不显示欢迎页面

转载 作者:行者123 更新时间:2023-12-05 07:36:52 26 4
gpt4 key购买 nike

我在 Ubuntu 17 安装后没有看到欢迎页面,只是在 Chrome 上显示“此页面不工作..ERR_EMPTY_RESPONSE”

下面是我的设置:

  1. 防火墙被禁用

sudo ufw disable
Firewall stopped and disabled on system startup

  1. 服务已启动并正在运行

    nginx.service - A high performance web server and a reverse proxy server
    Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/nginx.service.d
    └─override.conf
    Active: active (running) since Thu 2018-02-22 10:22:31 UTC; 1min 6s ago
    Process: 1356 ExecStartPost=/bin/sleep 0.1 (code=exited, status=0/SUCCESS)
    Process: 1270 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 1167 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Main PID: 1339 (nginx)
    Tasks: 2
    Memory: 9.2M
    CPU: 32ms
    CGroup: /system.slice/nginx.service
    ├─1339 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
    └─1345 nginx: worker process

    Feb 22 10:22:29 jitsinew systemd[1]: Starting A high performance web server and a reverse proxy server...
    Feb 22 10:22:31 jitsinew systemd[1]: Started A high performance web server and a reverse proxy server.
  2. 所有配置都是默认的,如下:

    {
    user www-data;
    worker_processes auto;
    pid /run/nginx.pid;
    include /etc/nginx/modules-enabled/*.conf;

    events {
    worker_connections 768;
    # multi_accept on;
    }

    http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    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;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

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

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
    }
  3. 在/etc/nginx/sites-enabled/下有一个名为default的文件,配置如下:

    server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;
    server_name _;
    location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
    }
    }

有什么想法吗?

最佳答案

我遇到了同样的问题,但我只是通过键入 service nginx start 来启动 nginx 以启动服务器,然后在我的浏览器中键入 localhost & 它工作了。

关于Nginx 在初始安装后不显示欢迎页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48917962/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com