nginx rancher部署

Last updated on September 15, 2024 pm

🧙 Questions

nginxlatest rancher安装

☄️ Ideas

创建服务

20221024121958

20221024122959

说明

  • Name: custom-nginx
  • Docker Image: nginx
  • Port Mapping:
    • Port Name: custom-nginx-p
    • Publish the container port: 80
    • On listening port: 30156
  • Volumes: Bind-mount a directory from the node
    • vol1:
      • Path on the Node:/data/nginx/nginx-forward/html
      • Mount Point: /usr/share/nginx/html
    • vol2:
      • Path on the Node: /data/nginx/nginx-forward/conf
      • Mount Point: /etc/nginx/conf.d
创建页面
sudo vim /data/nginx/nginx-forward/html/index.html
<html>
<head><title>hello world</title></head>
<body>
<center><h1>hello world</h1></center>
</body>
</html>
创建配置文件
sudo vim /data/nginx/nginx-forward/conf/default.conf
server {
    listen       80;
    listen  [::]:80;
    server_name  localhost;

    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}
访问端口号

重启访问页面

20221024140412


nginx rancher部署
https://ispong.isxcode.com/vue/nginx/nginx rancher部署/
Author
ispong
Posted on
May 28, 2021
Licensed under