Sign inSign up

yinjiangyue/simple-nginx

By yinjiangyue

•Updated 11 months ago

提供开箱即用的简易nginx配置, 用于设置https服务

Image
0

235

yinjiangyue/simple-nginx repository overview

example: APP1_NAME = myapp APP1_HOST= http://192.168.1.109:13004⁠

访问 https://192.168.1.109:13001/myapp⁠ 等价于访问 https://192.168.1.109:13004⁠

⁠docker-compose
version: '3.5'

services:
    #二级标签 自己随便起名字
    mynginx:
        #原版镜像nginx:1.23.1,这里已经将默认配置文件打包 可以不需要自己再注入template
        #若需要使用原版, 则数据卷都需要映射上 否则无法启动
        image: yinjiangyue/simple-nginx:1.1.0
        container_name: mynginx
        environment:
             #强制转发路径 如果访问到了80端口, 或者以http的形式访问到了443端口, 都会进行强制转发为这个地址
             FORCE_REDIRECT_URL: https://192.168.1.109:9090
            #所有环境变量都是必填 如果没有也得乱填 ROOT_HOST是/下的映射 NAME是自定义的映射
            ROOT_HOST: 192.168.1.109:13002
            APP1_NAME: webapi
            APP1_HOST: 192.168.1.109:13001
            APP2_NAME: not-used2
            APP2_HOST: 192.168.1.109:13002
            APP3_NAME: not-used3
            APP3_HOST: 192.168.1.109:13002
            APP4_NAME: not-used4
            APP4_HOST: 192.168.1.109:13002
            APP5_NAME: not-used5
            APP5_HOST: 192.168.1.109:13002
        #如果有需要 用文件替换以下模板
        #volumes:
        #- "./nginx.conf /etc/nginx/nginx.conf"
        #- "./default.conf.template:/etc/nginx/templates/default.conf.template"
        #- "./jy-demo.crt:/apps/cert/ssl.crt"
        #- "./jy-demo.key:/apps/cert/ssl.key"
        # 端口值一定要用字符串 不然报错
        ports:
            - "9090:443"
            - "9091:80"
        networks:
            - mynetwork
networks:
    mynetwork:
        name: mynetwork

Tag summary

Content type

Image

Digest

sha256:1081036c3…

Size

54.1 MB

Last updated

over 3 years ago

docker pull yinjiangyue/simple-nginx:1.2.0