【问题标题】:Nginx server only shows default pageNginx 服务器只显示默认页面
【发布时间】:2016-03-02 23:50:14
【问题描述】:

我的 Nginx 服务器有问题,因为它只显示默认页面。虚拟主机和主机文件似乎没问题。我不明白问题出在哪里。

这是我的虚拟主机配置:

server {
    listen   80;
    listen   [::]:80;
    listen 443 default ssl;
    server_name marketplace_unirgy;
    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;
    root /var/www/html/marketplace_unirgy/;
    index index.php;
    #location / {
    #       index index.html index.php;
    #       autoindex on;
    #       #If missing pass the URI to Magento's front handler
    #       try_files $uri $uri/ @handler;
    #       expires max;
    #}
    #need it to execute php
    location ~ \.php$ {
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            include fastcgi_params;
            include fastcgi.conf;
    }
    ## Magento uses a common front handler
    location @handler {
            rewrite / /index.php;
    }
}

还有我的主人:

127.0.0.1 marketplace_unirgy localhost

我的网站在/var/www/html/marketplace_unirgy

【问题讨论】:

    标签: nginx


    【解决方案1】:

    您似乎出于某种原因将默认位置注释掉了。尝试启用它:

    location / {
        try_files $uri $uri/ /index.php;
    }
    

    请参阅thisthis 了解更多信息。

    【讨论】:

    • 感谢您帮助我,我的 magento 数据库中的 'core_config_data' 中的字段 'patht' 存在问题。如果此值未正确设置,您的 URL 将被重定向到此字段内的值。它对我隐藏。
    猜你喜欢
    • 2021-12-30
    • 1970-01-01
    • 2013-12-21
    • 2015-03-09
    • 2017-10-01
    • 2020-07-24
    • 2019-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多