请教关于 nginx 配置问题

来源:10-6 在Docker中部署前端项目

johnny_2008

2023-04-03

老师您好
配置文件,没有配置 server ,为什么在 docker 环境可以正常访问项目呢?
我在 window 使用相同的配置文件 nginx 都无法启动(已修改 include 值)

user  nginx;
worker_processes  auto;
error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    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;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}
写回答

1回答

神思者

2023-04-03

nginx版本不同配置方法也不一样,何况Linux文件路径跟Windows也不同

0
1
johnny_2008
非常感谢!
2023-04-04
共1条回复

SpringBoot+Vue3 项目实战,打造企业级在线办公系统

以业务为基础,贯穿前后端技术栈,获得企业级项目开发经验

2237 学习 · 1264 问题

查看课程