update
This commit is contained in:
parent
91e5dce938
commit
cc98e5dccb
@ -59,10 +59,11 @@ RUN chown -R nginx:nginx /usr/share/nginx/html \
|
|||||||
&& chown -R nginx:nginx /var/log/nginx \
|
&& chown -R nginx:nginx /var/log/nginx \
|
||||||
&& chmod -R 755 /var/log/nginx \
|
&& chmod -R 755 /var/log/nginx \
|
||||||
&& touch /var/run/nginx.pid \
|
&& touch /var/run/nginx.pid \
|
||||||
&& chown -R nginx:nginx /var/run/nginx.pid
|
&& chown -R nginx:nginx /var/run/nginx.pid \
|
||||||
|
&& chmod -R 755 /etc/nginx/conf.d
|
||||||
|
|
||||||
# 使用非root用户运行
|
# 使用root用户运行nginx(标准做法)
|
||||||
USER nginx
|
# USER nginx
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
# 移除 user 指令,因为我们以非 root 用户运行
|
# 使用标准的nginx配置结构
|
||||||
|
user nginx;
|
||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
@ -15,7 +18,6 @@ http {
|
|||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log main;
|
access_log /var/log/nginx/access.log main;
|
||||||
error_log /var/log/nginx/error.log warn;
|
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user