NGINX
Installation
Building NGINX in Docker
Configuration
Two server block, serving static files
http {
index index.html;
server {
server_name www.domain1.com;
access_log logs/domain1.access.log main;
root /var/www/domain1.com/htdocs;
}
server {
server_name www.domain2.com;
access_log logs/domain2.access.log main;
root /var/www/domain2.com/htdocs;
}
}Default Catch All Server Block
Wildcard subdomain
Reverse Proxy with Caching
SSL Certificate
Prevent accessing default page using ip
Return inline html
Block to root, but allow to specific file
Some Errors
Docker: Cannot load certificate when specifiying certificate in same folder: ssl_certificate cert.crt
“http” directive is not allowed here in
Reference
Last updated