Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/bci_build/package/nginx/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,37 @@ The template above is then rendered to `/etc/nginx/conf.d/default.conf` as follo
listen 80;
```

## Running nginx as a non-root user
It is possible to run the image as a less privileged user. This requires updating the nginx configuration to use directories writable by a specific UID/GID:
```ShellSession
$ 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 {{ image.pretty_reference }}
```

Define a new path for the process ID in `nginx.conf`:

```ShellSession
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```ShellSession
```Nginx

pid /tmp/nginx.pid;
```

Adjust the HTTP context paths and ports in `nginx.conf`:
```ShellSession
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```ShellSession
```Nginx

http {
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
...
...
server {
listen 8080;
...
...
}
...
}
```

## Environment variables

### NGINX_ENTRYPOINT_QUIET_LOGS
Expand Down