Skip to content

Commit b7bf911

Browse files
author
SUSE Update Bot
committed
Test build for #3071
1 parent a049809 commit b7bf911

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

nginx-image/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,37 @@ The template above is then rendered to `/etc/nginx/conf.d/default.conf` as follo
4444
listen 80;
4545
```
4646

47+
## Running nginx as a non-root user
48+
It is possible to run the image as a less privileged arbitrary UID/GID. This, however, requires modification of nginx configuration to use directories writeable by that specific UID/GID pair:
49+
```ShellSession
50+
$ podman run -it --user nginx --rm -p 8080:8080 -v /path/to/html/:/srv/www/htdocs/:Z -v $PWD/nginx.conf:/etc/nginx/nginx.conf:Z registry.suse.com/suse/nginx:1.27
51+
```
52+
53+
where nginx.conf in the current directory should have the following directives re-defined:
54+
55+
```ShellSession
56+
pid /tmp/nginx.pid;
57+
```
58+
59+
And in the http context:
60+
```ShellSession
61+
http {
62+
client_body_temp_path /tmp/client_temp;
63+
proxy_temp_path /tmp/proxy_temp_path;
64+
fastcgi_temp_path /tmp/fastcgi_temp;
65+
uwsgi_temp_path /tmp/uwsgi_temp;
66+
scgi_temp_path /tmp/scgi_temp;
67+
...
68+
...
69+
server {
70+
listen 8080;
71+
...
72+
...
73+
}
74+
...
75+
}
76+
```
77+
4778
## Environment variables
4879

4980
### NGINX_ENTRYPOINT_QUIET_LOGS

0 commit comments

Comments
 (0)