提交 8fe04e84 编写于 作者: 小傅哥's avatar 小傅哥

feat: init project add nginx config

上级
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
\ No newline at end of file
# 命令执行 docker-compose -f nginx-docker-compose.yml up -d
version: '3.9'
services:
nginx_01:
image: nginx:1.25.3
container_name: nginx_01
restart: always
ports:
- '8090:80'
volumes:
- ./nginx01/html:/usr/share/nginx/html
- ./nginx01/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx01/conf/conf.d:/etc/nginx/conf.d
privileged: true
nginx_02:
image: nginx:1.25.3
container_name: nginx_02
restart: always
ports:
- '8091:80'
volumes:
- ./nginx02/html:/usr/share/nginx/html
- ./nginx02/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx02/conf/conf.d:/etc/nginx/conf.d
privileged: true
\ No newline at end of file
server {
listen 80;
listen [::]:80;
location / {
root /usr/share/nginx/html;
index index.html;
}
location /api {
# 假设你想要显示的 HTML 文件名为 api.html
root /usr/share/nginx/html;
index index.html;
# try_files $uri $uri/ /api.html; # 尝试访问 /api.html
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
\ No newline at end of file
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>小傅哥</title>
</head>
<body>
HI XFG!01
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>小傅哥</title>
</head>
<body>
HI XFG!
</body>
</html>
\ No newline at end of file
server {
listen 80;
listen [::]:80;
location / {
root /usr/share/nginx/html;
index index.html;
}
location /api {
# 假设你想要显示的 HTML 文件名为 api.html
root /usr/share/nginx/html;
index index.html;
# try_files $uri $uri/ /api.html; # 尝试访问 /api.html
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
\ No newline at end of file
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>小傅哥</title>
</head>
<body>
HI XFG!02
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>小傅哥</title>
</head>
<body>
HI XFG!
</body>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>xfg-dev-tech-higress</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册