Installation#
$ dnf install nginx
Configuration#
The configuration file is located at /etc/nginx/nginx.conf.
http {
server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
}
}
Reverse Proxy to PKI Server#
To configure reverse proxy to PKI server:
http {
server {
location /pki/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080/pki/;
}
location /ca/ {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080/ca/;
}
}
}
If SELinux is enabled, execute the following command:
$ setsebool -P httpd_can_network_connect 1
Starting Systemd Service#
To start Nginx:
$ systemctl start nginx
To verify, open http://localhost.localdomain.
Logging#
The log files are located in /var/log/nginx.