When configuring nginx with a site that has ssl, the examples I find online basically duplicate the location settings. Most examples only have the default root location so it's not that big of a deal, but when you have a few locations and rewrite rules in place duplicating this configuration gets messy to maintain.
I've considered proxying the ssl requests to localhost to get around this, but that's kind of ugly. I've also considered using file includes, but the location configs for this site should be in 1 file since they are related.
Any suggestions?
Edit: We're using nginx version 0.6.32.
Yes, its technically possible to install 2 nginx instances on the same server but I would do it another way. 1 - You could just create multiple EC2 instances.
Through a simple command you can verify the status of the Nginx configuration file: $ sudo systemctl config nginx The output will show if the configuration file is correct or, if it is not, it will show the file and the line where the problem is.
In Nginx, keepalive is a directive that is utilized for keeping the connection open for a certain number of requests to the server or until the request timeout period has expired.
There's a similar question on serverfault. Here's their answer:
server {
listen 80;
listen 443 default ssl;
# other directives
}
The ssl parameter is included as of 0.7.14, which means we can't use it, but it's a good solution if you're on a newer version of nginx.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With