Nextcloud port change

Hi , I installed Nextcloud ( Lighttpd ) on my N2+ with noip and letsencrypt port forwarding 80/443 everything works perfect but now if I want to switch 80/443 to something like 8080/8443 how ?

I am using winscp for directly editing conf file , i went to lighttpd.conf i can only see

server.document-root = “/var/www”
server.upload-dirs = ( “/var/cache/lighttpd/uploads” )
server.errorlog = “/var/log/lighttpd/error.log” = “/run/”
server.username = “www-data”
server.groupname = “www-data”
server.port = 80

But what about 443 ? how can I change ? I am using ASUS RT-AX92U router and how to redirect 80/443 to 8080/8443 ? thanks !

Have a look to folder /etc/lighttpd/conf-available/. There should be a file for https configuration. But why do you like to change ports? Any specific need?

Someone attacking these two ports 80/443 everyday that’s why I need to change to something else , can you show me how and which line for editing port ?

Yeah these are the default http/https ports and quite common. No surprise that they are found by robots.

Theoretically you could change ports. This is not an issue. But you will loose possibility to create/recreate new SSL certificates using certbot. Because Let’s Encrypt will try to validate your domain using port 80.

Are you sure you want do that?

Depending on the actual websites/apps served by the webserver and the kind of attacks, another option would be to use fail2ban for blocking the hosts after a certain amount of failed logins, missing script access and such. How do the attacks look like on Lighttpd or backend logs?