Table of Contents |
---|
Create our Docker Container
...
Code Block | ||
---|---|---|
| ||
server { listen 8443 ssl; #server_name svn svn.jmehan.com; ssl_certificate /etc/nginx/certificates/svn/cert.pem; ssl_certificate_key /etc/nginx/certificates/svn/key.pem; location / { proxy_pass http://192.168.1.60:9080/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } } |
See Also
Adding Basic Authentication
You may need to add apache2-utils to your nginx docker container using the following cmd:
> sudo apt-get install apache2-utils
Login to the docker container and create the password file
> docker exec -it <nginx_container> bash
Create a password file
> htpasswd -c /etc/nginx/conf.d/htpasswd <username>
Update the configuration
Code Block |
---|
server {
server_name kibana kibana.jmehan.com;
location / {
proxy_pass http://192.168.1.60:5601/;
auth_basic "Administrator's Area";
auth_basic_user_file /etc/nginx/conf.d/htpasswd;
}
} |
References
Reference |
---|
URL | |
---|---|
Let's Encrypt | CertBot and Let's Encrypt |
Restricting Access with HTTP Basic Authentication | https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ |