laravel - nginx:配置文件 /etc/nginx/nginx.conf 在 Laravel 项目中测试失败
问题描述
我使用 Ubuntu 将 Laravel-5.8 项目上传到 DigitalOcean 服务器。该网站运行良好。后来我决定创建虚拟主机,以便能够在同一台服务器上托管多个应用程序。
我点击了这个链接:
https://graspingtech.com/nginx-virtual-hosts-ubuntu-16-04/
现在我做了:
root@MyServer: cp /etc/nginx/sites-available/default /etc/nginx/sites-available/site1.conf
root@MyServer: cp /etc/nginx/sites-available/default /etc/nginx/sites-available/site2.conf
然后
root@MyServer: ln -s /etc/nginx/sites-available/site1.conf /etc/nginx/sites-enabled/
root@MyServer: ln -s /etc/nginx/sites-available/site2.conf /etc/nginx/sites-enabled/
然后当我这样做时:
root@MyServer: nginx -t
我收到了这个错误:
nginx:配置文件 /etc/nginx/nginx.conf 测试失败
这是/etc/nginx/nginx.conf的内容
ser 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;
# set client body size to 5M #
client_max_body_size 24000M;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
我该如何解决这个问题?
谢谢
解决方案
推荐阅读
- ffmpeg - ffmpeg rtsp 记录段和文件夹-文件名
- python - 从 Python 和 PostgreSQL 中提取星期几时的差异,有什么解决方案吗?
- python - 如何使用 OCR Pytesseract 删除文本提取后出现的箭头符号
- amazon-web-services - AWS CLI:api gateway get-usage 不返回所有密钥的使用情况
- javascript - 如何在 Amp 上创建添加到主屏幕?
- reactjs - prevstate 有什么用?
- azure - 升级 Azure SQL 服务器
- python - 如何知道一个进程是否从python中的cron启动
- python - 我如何打印字符串中的所有内容,直到python中的第一个数字?
- mysql - MySQL 因未解决的内存问题而崩溃