Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #82

Merged
merged 14 commits into from
Mar 28, 2022
Prev Previous commit
Next Next commit
补上80端口配置
  • Loading branch information
jingjingxyk committed Mar 27, 2022
commit 27a70e785c0945ad4b277285773388d4bd836c26
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extension.zip
.DS_Store
Thumbs.db
server/nginx.conf
server/conf.d
server/tls/*
!server/tls/.gitkeep

1 change: 1 addition & 0 deletions server/get-nginx-default-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cd ${__DIR__}
# 获得nginx 默认配置文件
container_id=$(docker create nginx:alpine) # returns container ID
docker cp "$container_id":/etc/nginx/nginx.conf nginx.conf
docker cp "$container_id":/etc/nginx/conf.d/ conf.d

# shellcheck disable=SC2086
docker rm $container_id
48 changes: 48 additions & 0 deletions server/nginx-ok.conf
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,52 @@ http {
}
}


server {
listen 80 default_server;
listen [::]:80 default_server;
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;
#}
}



}
2 changes: 1 addition & 1 deletion server/run-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd "${__DIR__}"

docker run --rm \
--name nginx-proxy-server \
-p 8081:80 \
-p 80:80 \
-p 443:443 \
-v "${__DIR__}"/nginx-ok.conf:/etc/nginx/nginx.conf \
-v "${__DIR__}"/custom-proxy-header.item:/etc/nginx/conf.d/custom-proxy-header.item \
Expand Down