I don't know if I can ask questions like this here, but here we go:
I installed Ubuntu Server 18.04.2 LTS on an old iMac. I installed Nginx, MySQL, phpMyAdmin and about to install let's encrypt -> I have myowndomainname.com which I can use. I followed this tutorial/manual: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04
Now I want to know how I can make my website which is running on a private ip address (192.168.x.x) run on my public ip adres. Can I do this with port forwarding? Or can I change my Ubuntu Server ipv4 to the public ip address? -> I know this not really secure.
What is the best solution for this? Which ports do I need to forward if I want to use HTTP/HTTPS/SSH/FTP? My provider gives me these options with portforwarding:
Local IP
Local start port
Local end port
Extern start port
Extern end port
Protocol: TCP/UDP/BOTH
I also can configure trigger ports or add ipv4-filter-rules
The nginx file looks like this:
server {
listen *:80;
root /var/www/html/myowndomainname.com;
index index.php index.html index.htm index.nginx-debian.html;
server_name myowndomainname.com www.myowndomainname.com;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
I also tried to disable ufw, which didn't help. I tried to use my public ip with port :80 and other ports. This didn't do anything.