Welcome! Log In Create A New Profile

Advanced

Trouble setting up SSL in nginx

Posted by cableghost 
Trouble setting up SSL in nginx
March 17, 2021 07:23PM
I cannot get nginx to run with my SSL server section, otherwise it works fine.

I have nginx running in a Windows-based VM.
I've forwarded both ports to this VM.

Below is my config... what do I have wrong?

#user nobody;
worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

server {
listen 81;
server_name localhost 192.168.1.199;

location / {
root html;
index index.html index.htm;
}

location /sonarr {
proxy_pass http://127.0.0.1:8989/sonarr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
}

location /radarr {
proxy_pass http://127.0.0.1:7878/radarr;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
}

location /qbt/ {
proxy_pass http://127.0.0.1:8080/qbit;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
http2_push_preload on; # Enable http2 push
}

location /sab/ {
proxy_pass http://localhost:8085/sabnzbd/;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

}

#HTTPS server

server {
listen 91;
ssl on;
server_name mydomain.com;

ssl_certificate "C:/certs/45649670_mydomain.com.cert";
ssl_certificate_key "C:/certs/45649670_mydomain.com.key";

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location / {
root /var/www/;
root /home/www/public_html/mydomain.com/public/;
index index.html index.htm;
}
}
}
Re: Trouble setting up SSL in nginx
March 17, 2021 09:34PM
Solved. Below is the SSL server code...

server {
listen 91 ssl;
server_name mydomain.com;

ssl_certificate "C:/certs/mydomain.com.pm";
ssl_certificate_key "C:/certs/mydomain.com-key.pm";

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location / {
root /home/www/public_html/mydomain.com/public/;
index index.html index.htm;
}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 54
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready