Change port of NGINGX (443-> 4443) : l'API ne répond pas (Erreur : 0 error)

Here is the job/problem : I want to change the port of nginx from 443 to 4443.

I did :
modification of /etc/nginx/conf.d/yunohost_admin.conf

10 server {
11 listen 4443 ssl default_server;

modification of /etc/nginx/conf.d/fqdn.conf
17 server {
18 listen 4443 ssl;

Seems nginx is listenning on port :

netstat -lntpu | grep 443
tcp 0 0 0.0.0.0:4443 0.0.0.0:* LISTEN 19311/nginx

https://192.168.0.253:4443/yunohost/api/installed is telling me :
{“installed”: true}

But I can’t log in the website (api had been started with /etc/init.d/yunohost-api restart )

Firewall is open :

yunohost firewall list
openned_ports:

  • 22
  • 25
  • 53
  • 443
  • 465
  • 993
  • 5222
  • 5269
  • 5290
  • 80
  • 4443

I tryed to concatenate url with port in : /usr/share/yunohost/admin/js/app.js

141 jQuery.ajax({
142 //url: ‘https://’+ store.get(‘url’) + uri,
143 url: ‘https://’+ store.get(‘url’ + ‘:4443’ ) + uri,

But seems it can’t work due to same origin policy if I understood well

So can I have any help / clue about this. At the end I want to have this configuration :

443 – SSLH listening (and redirecting request

– for https --> 4443
– for ssh --> 22
– adn so on

I always got this errror :

https://IP:4443/yunohost/admin/#/login
l’API ne répond pas (Erreur : 0 error)

thx in advance for reply

Hello,

I have exactly the same issue and trying to find a way to make it work also.
Yunohost v1 was perfectly working in this kind of configuration. I have to do the same since i want my ssh server to be accessed on port 443 also.

Try to change (or add) the the parameter portal_port in the /etc/ssowat/conf.json file.

If it works try to add it to /etc/ssowat/conf.json.persistent to avoid its overwriting.

Thanks for your answer.
The change in /etc/ssowat/conf.json works perfectly. I’ll try to report the same in /etc/ssowat/conf.json.persistent

Unfortunetly I don’t have time for test nowadays at home. I m keeping this in mind. Thanks for answer (will install yunohost on bananapi when … I ll open the bananapi box and have at least one day for me :sleepy: )

It’s not working form me, adding portal_port don’t change anything.

I have try with ufw to redirect port without success :frowning:

Hello,

I have exactly the same issue, no matter what I try to have yunohost on a different port than 443, I get :

l’API ne répond pas (Erreur : 0 error)

Is there some other tricks not mentionned above that could make it works ?

Thx

Hello,
For me the trick worked for a moment but then I updated to v 2.2 and admin is broken again.
Fortunately I can use command line and apps are working fine.
I have the feeling that port 443 have to be manually updated after each package update for now.