3 ms·
What's wrong with this? server { listen 80; server_name blog.kixpanganiban.com; return 301 https://$server_name$request_uri; } serve
by izietto 10y ago
What's wrong with this?
server {
listen 80;
server_name blog.kixpanganiban.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name blog.kixpanganiban.com;
ssl_certificate /etc/letsencrypt/live/blog.kixpanganiban.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/blog.kixpanganiban.com/privkey.pem;
charset utf-8;
# max upload size
client_max_body_size 75M;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://localhost:2368/;
}
}
Every line is self-explanatory, blocks define clearly where some directive is applied and where not, you just have to read some well-written docs in order to spot the right directive. And this came after Apache configuration mess, when almost nothing did better. Maybe lighttpd, but lighttpd was missing of some essential web server options.
- icebraining 10y agoI think the point is that the default configuration is too verbose; after all, you don't have to touch most Nginx options for a typical configuration, so why do you still have to configure so much stuff? I think the point has some merit, though I personally don't really care.
- dano 10y agoExactly. There is no magic. Simple, powerful, precise.
- mholt 10y agoI didn't write Caddy because something was wrong with nginx, it just wasn't a good fit for my workflow that makes me most productive.