"nginx error!" 正在加载网页

"nginx error!" while loading webpage

背景:我已经安装并正在维护一个 OTRS v4.0 系统,使用 nginx 作为网络服务器。系统是 运行,直到我在 nginx.conf 中也添加了 ssl 端口,从那时起,我正在尝试连接到网页

http://localhost/otrs/index.pl

但没有响应并显示 nginx 错误!没有找到您要找的页面。

我从 nginx.conf 文件中删除了 ssl 部分,但我仍然无法恢复以前的网页状态。

有什么不用重新安装otrs的方法吗?或我错过检查的任何其他日志文件

# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

events {
    worker_connections 1024;
    #debug_connection 10.0.2.15;
}

http {
    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  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

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

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        #listen       80;
        server_name  server.unixmen.local;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

?

提前致谢!

您混淆了默认服务器,nginx 正在尝试提供错误的内容。

OTRS 使用 fastcgi 并将在 /etc/nginx/conf.d 目录中拥有自己的配置文件。您 posted 的文件是默认的 nginx 配置,与 OTRS 几乎没有关系。

将您的监听指令更改为:

    #listen       80 default_server;
    listen       80;

这将阻止默认的 nginx 配置处理与 https://localhost 的未知主机连接,并假设它之前工作正常,那么系统应该再次工作。如果没有,那么 post 来自 /etc/nginx/conf.d/something.conf 的 OTRS 配置,我们将能够看到发生了什么。

感谢您的回复。我得到了解决方案! 也许,这是我的一个愚蠢的错误 ;)

首先,我忘了在问题中提到我还在同一台机器上 运行 另一个 Web 服务器 Apache。在初始阶段,两台服务器都配置在相同的端口 ->80。因此,OTRS 在 Apache 而不是 nginx 上是 运行(我也将其用于另一个目的!)。后来,为了避免混淆,我将 Apache 配置中的端口从 80 更改为 8080,从这一刻起,服务器停止为 OTRS 提供服务。 所以现在,当我使用 http://localhost:8080/otrs/index.pl 它工作正常。

下一次,我会在多个 Web 服务器上工作时谨慎地明智地更改服务器配置。