跳板机装好Nginx之后在/etc/nginx/nginx.conf中,在http模块下定义好include,以便使配置模块化

http {
    # some config

    include /etc/nginx/conf.d/*.conf

    # some config
}

这样在conf.d中的所有conf文件都可以被读到。

在conf.d中创建一个文件proxy.conf,并且写入以下内容

server {
    listen 80;
    server_name proxy.mydomain.com;
    # replace server_name with your own domain name
    location /stage/ {
        proxy_pass https://targetlink.com
        # replace proxy_pass with your target resource
    }
}

这样就初步配置好了一台跳板机

Last modified: 13/11/2023

Author

Comments

Write a Reply or Comment

Your email address will not be published.