wiki icon indicating copy to clipboard operation
wiki copied to clipboard

After upgrading to 2.3.81 SSL is not working.

Open devp01 opened this issue 6 years ago • 7 comments

Question Describe in detail what you are trying to achieve and where do you need guidance.

Enable SSL port on wiki.js

Host Info (please complete the following information): OS: [ Ubuntu 18.04] Wiki.js version:2.3.81 Database engine: mysql 8.0.17

Prior to the upgrade, I was able to install SSL certificate on the wiki.js (version -2.1.113) , But after the upgrade to 2.3.81, my https connection is not working. I am using nginx for proxy and SSL.

Prior to the upgrade on the Admin SSL section, I was able to configure the following. HTTP Port 3000 HTTPS Port 40961 Redirect HTTP requests to HTTPS true

But after the upgrade under the Admin SSL section, I cannot see the section to Redirect HTTP requests to HTTPS. It is only showing HTTP port. I had to disable SSL configuration on nginx for accessing the website to get access to the admin console after the upgrade. HTTP Port 3000

On the config.yml I have enabled SSL to be true. Is there any other setting that I am missing for this to work. Please advise.

devp01 avatar May 18 '20 05:05 devp01

Wait, do you want to have SSL between Nginx and Wiki.js? Or just wanted your Wiki.js accessed with HTTPS from the browser? Or both of them?

Smankusors avatar May 18 '20 08:05 Smankusors

@Smankusors Just wanted wiki.js to be accessed via HTTPS from the browser.

devp01 avatar May 19 '20 09:05 devp01

Then you don't need to enable SSL on Wiki.js. Just on the Nginx side.

Smankusors avatar May 19 '20 10:05 Smankusors

Thank you. I tried this but it is giving me a 502 gateway error. On my Admin console, I have enabled image

I have also changed the trustProxy: true on the config.yml file.

Is there anything that I am missing out.

My nginx config is as follows: server {

listen 80;
root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;

server_name domain_name; location / { proxy_ssl_server_name on; proxy_pass https://domain_name:3000; }
if ($server_port = 80){ rewrite ^/(.)$ https://domain_name/$1 permanent; } if ($server_port = 3000) { rewrite ^/(.)$ https://domain_name/$1 permanent; } }

server { listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl on; server_name domain_name; ssl_certificate /etc/nginx/SSL/name.crt; ssl_certificate_key /etc/nginx/SSL/ssl.key; location / { proxy_pass https://domain_name:3000; proxy_ssl_server_name on; }

if ($server_port = 80) { rewrite ^/(.*)$ https://domain_name/$1 permanent; }

if ($server_port = 3000) { rewrite ^/(.*)$ https://domain_name/$1 permanent; } }

I checked the settings in the database and for security key value, security | {"securityCSP": false, "securitySRI": false, "securityHSTS": false, "securityIframe": false, "securityTrustProxy": true, "securityHSTSDuration": 300, "securityCSPDirectives": "", "securityReferrerPolicy": false}

for server key value server | {"sslRedir": false}

Please advise.

devp01 avatar May 19 '20 11:05 devp01

@Smankusors Thank you. I tried this but it is giving me a 502 gateway error. On my Admin console, I have enabled image

I have also changed the trustProxy: true on the config.yml file.

Is there anything that I am missing out.

My nginx config is as follows: server {

listen 80; root /var/www/html;

index index.html index.htm index.nginx-debian.html; server_name domain_name; location / { proxy_ssl_server_name on; proxy_pass https://domain_name:3000; } if ($server_port = 80){ rewrite ^/(.)$ https://domain_name/$1 permanent; } if ($server_port = 3000) { rewrite ^/(.)$ https://domain_name/$1 permanent; } }

server { listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl on; server_name domain_name; ssl_certificate /etc/nginx/SSL/name.crt; ssl_certificate_key /etc/nginx/SSL/ssl.key; location / { proxy_pass https://domain_name:3000; proxy_ssl_server_name on; }

if ($server_port = 80) { rewrite ^/(.*)$ https://domain_name/$1 permanent; }

if ($server_port = 3000) { rewrite ^/(.*)$ https://domain_name/$1 permanent; } }

I checked the settings in the database and for security key value, security | {"securityCSP": false, "securitySRI": false, "securityHSTS": false, "securityIframe": false, "securityTrustProxy": true, "securityHSTSDuration": 300, "securityCSPDirectives": "", "securityReferrerPolicy": false}

for server key value server | {"sslRedir": false}

Please advise.

devp01 avatar May 19 '20 13:05 devp01

Change https to http in your proxy_pass for both.

NGPixel avatar May 19 '20 14:05 NGPixel

@NGPixel Thank you. It worked.

devp01 avatar May 20 '20 11:05 devp01