欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mac 下配置 nginx 域名转发

程序员文章站 2022-03-04 12:49:21
...

1. 配置nginx域名转发

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    gzip        on;

    server {
        listen       80;
        server_name www.evy123.com;
        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://localhost:8080;
        }
    }
}

2.配置本定host映射,否则无法解析出域名ip

vim /etc/hosts

#添加以下内容
127.0.0.1 www.evy123.com

 

相关标签: nginx