Skip to content

Commit 5c43658

Browse files
author
SUSE Update Bot
committed
Test build for #3071
1 parent e384f7a commit 5c43658

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
@@ -43,6 +43,37 @@ The template above is then rendered to `/etc/nginx/conf.d/default.conf` as follo
4343
listen 80;
4444
```
4545

46+
## Running nginx as a non-root user
47+
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:
48+
```ShellSession
49+
$ 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.21
50+
```
51+
52+
where nginx.conf in the current directory should have the following directives re-defined:
53+
54+
```ShellSession
55+
pid /tmp/nginx.pid;
56+
```
57+
58+
And in the http context:
59+
```ShellSession
60+
http {
61+
client_body_temp_path /tmp/client_temp;
62+
proxy_temp_path /tmp/proxy_temp_path;
63+
fastcgi_temp_path /tmp/fastcgi_temp;
64+
uwsgi_temp_path /tmp/uwsgi_temp;
65+
scgi_temp_path /tmp/scgi_temp;
66+
...
67+
...
68+
server {
69+
listen 8080;
70+
...
71+
...
72+
}
73+
...
74+
}
75+
```
76+
4677
## Environment variables
4778

4879
### NGINX_ENTRYPOINT_QUIET_LOGS

0 commit comments

Comments
 (0)