nginx - Nginx 只显示欢迎页面
问题描述
我只是为子域设置了 nginx,即便如此,我仍然只得到欢迎页面。
这是我在 nginx sites-available 上设置的代码
server {
listen 80;
server_name sub.domain.ro;
rewrite ^ https://sub.domain.ro$request_uri? permanent;
}
server {
listen 443 ssl http2;
# ssl_certificate /etc/letsencrypt/live/testsite.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/testsite.com/privkey.pem;
# ssl_stapling on;
server_name sub.domain.ro;
root /var/www/sub.domain.ro;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
请让我知道我做错了什么或在这里忘记了什么。
解决方案
推荐阅读
- java - 使用导航选项卡打开相机
- c# - 如何选择数据并将结果存储在变量中
- ios - 输入 UISearchBar 后,UITableView 最初不会重新加载
- html - 如何将 html id 从 react 传递给 html?
- android - Android:SaveState、Fragments 和 ViewModel:我做错了什么?
- xtermjs - 检查终端是否空闲
- amazon-web-services - 如何在 CloudWatch 计划 + SQS 上触发 AWS Lambda
- javascript - 如何为页面上的所有标题添加属性?
- php - laravel :从数据库中删除记录后,新记录在已删除记录的位置
- php - php check whether the user has uploaded a profile pic or not