Nginx-04-Docker Nginx

Docker Nginx 实战

HTTP 服务

Nginx 的最大作用,就是搭建一个 Web Server。

有了容器,只要一行命令,服务器就架设好了,完全不用配置。

  • 运行官方 image
lua 复制代码
$ docker container run \
  -d \
  -p 8080:80 \
  --rm \
  --name mynginx \
  nginx

参数说明:

diff 复制代码
-d:在后台运行
-p :容器的80端口映射到127.0.0.1:8080
--rm:容器停止运行后,自动删除容器文件
--name:容器的名字为mynginx
  • 访问

打开 http://127.0.0.1:8080/

内容如下:

vbnet 复制代码
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

映射网页目录

ruby 复制代码
$ docker container run \
  -d \
  -p 127.0.0.1:8080:80 \
  --rm \
  --name mynginx \
  --volume "$PWD":/usr/share/nginx/html \
  nginx

直接访问 http://127.0.0.1:8080/,即可看到 index.html 内容。

nginx 系列

Nginx-01-聊一聊 nginx

Nginx-01-Nginx 是什么

Nginx-02-为什么使用 Nginx

Nginx-02-Nginx Ubuntu 安装 + windows10 + WSL ubuntu 安装 nginx 实战笔记

Nginx-02-基本使用

Nginx-03-Nginx 项目架构

Nginx-04-Docker Nginx

Nginx-05-nginx 反向代理是什么?windows 下如何配置使用 nginx

Nginx-06-nginx 汇总入门介绍

Nginx R31 doc 官方文档-01-nginx 如何安装

Nginx R31 doc-02-nginx 基本功能

Nginx R31 doc-03-HTTP Load Balancing HTTP 负载均衡

Nginx R31 doc-04-HTTP Health Checks

Nginx R31 doc-05-Dynamic Configuration of Upstreams with the NGINX Plus API 使用 NGINX Plus API 动态配置上游服务器

Nginx R31 doc-06-Accepting the PROXY Protocol

Nginx R31 doc-07-内容缓存

Nginx R31 doc-08-Configuring NGINX and NGINX Plus as a Web Server 配置 NGINX 和 NGINX Plus 作为 Web 服务器

Nginx R31 doc-09-Serving Static Content 静态内容

Nginx R31 doc-10-NGINX Reverse Proxy 反向代理

Nginx R31 doc-11-Compression and Decompression 压缩与解压缩

Nginx R31 doc-12-NGINX SSL Termination 安全加密

Nginx R31 doc-13-Limiting Access to Proxied HTTP Resources 访问限流

Nginx R31 doc-14-Dynamic Denylisting of IP Addresses 动态拒绝IP地址

Nginx R31 doc-15-Live Activity Monitoring 实时活动监控

Nginx R31 doc-16-logging 配置日志

Nginx R31 doc-17-debugging 调试

Nginx R31 doc-18-High Availability Support for NGINX Plus in On-Premises Deployments

Nginx 实战-01-nginx ubuntu 安装笔记

Nginx 实战-01-nginx windows 安装笔记

Nginx 实战-02-nginx proxy_pass 服务代理访问 使用笔记 ubuntu nodejs

Nginx 实战-03-nginx 负载均衡

Nginx 实战-04-nginx 不同的地址访问不同的服务

Nginx 实战-05-nginx 反向代理实现域名到指定的 ip

相关推荐
ldj20205 分钟前
SpringBoot为什么使用new RuntimeException() 来获取调用栈?
java·spring boot·后端
超龄超能程序猿6 分钟前
Spring 应用中 Swagger 2.0 迁移 OpenAPI 3.0 详解:配置、注解与实践
java·spring boot·后端·spring·spring cloud
风象南18 分钟前
SpringBoot配置属性热更新的轻量级实现
java·spring boot·后端
洛阳泰山19 分钟前
Spring Boot 整合 Nacos 实战教程:服务注册发现与配置中心详解
java·spring boot·后端·nacos
Y40900119 分钟前
C语言转Java语言,相同与相异之处
java·c语言·开发语言·笔记
YuTaoShao20 分钟前
【LeetCode 热题 100】994. 腐烂的橘子——BFS
java·linux·算法·leetcode·宽度优先
布朗克16820 分钟前
java常见的jvm内存分析工具
java·jvm·数据库
都叫我大帅哥1 小时前
深入浅出 Resilience4j:Java 微服务的“免疫系统”实战指南
java·spring cloud
Cao_Shixin攻城狮3 小时前
Flutter运行Android项目时显示java版本不兼容(Unsupported class file major version 65)的处理
android·java·flutter
Dcs6 小时前
还在用 Arrays.hashCode?Java 自己也能写出更快的版本!
java