0

我尝试按照手册( server_name .site.name) 中的说明实现此目的,但它似乎不起作用 ( 404 Not found)。我可以在不重定向的情况下执行此操作吗?

这是配置。

server {
    listen 80;
    listen 443 ssl;
    server_name .site.name;

    ssl_certificate     certs/mshop-production.crt;
    ssl_certificate_key certs/mshop-production.key;
    passenger_set_cgi_param HTTP_X_FORWARDED_PROTO $scheme;

    error_log /var/log/nginx/mshop-production.error.log error;
    access_log /var/log/nginx/mshop-production.access.log;

    root /home/deployer/apps/production/mshop/current/public;
    passenger_enabled on;
    rails_env production;

    gzip on;
    gzip_types application/x-javascript application/javascript text/javascript text/css;

    client_max_body_size 50m;

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires 1M;
    }
}
4

2 回答 2

2

为什么不在你的域名服务器中修改你的A查询记录呢?

我认为这对你来说更简单。

于 2013-10-17T11:45:14.770 回答
1
 server_name server.name www.server.name;

会做。您还可以使用通配符

 server_name server.name *.server.name;
于 2013-10-17T11:45:23.790 回答