For security reasons, I am recommending setting up a proxy between the Internet and your SSH server. You can skip steps #1 and #2 and use a port number above 1024 such as 8080. Never run the SSH server directly on port 80 as that requires privilege.
STEP 1)
Install Apache or Nginx.
STEP 2)
Set up a proxy in Apache/Nginx to forward connections on port 80 to port 8080.
Example configuration for Nginx:
server {
listen 80;
server_name example.com;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass "http://127.0.0.1:8080";
}
}
STEP 3)
Configure the VM SSH server to allow port forwarding option AllowTcpForwarding.
Setup the tunnel to open port 8080 on the VM and forward to the listening port on your Raspberry Pi (example 9000).
Example SSH command to run on the raspberry Pi:
ssh -R 8080:127.0.0.1:9000 <VM IP Address> <Your credentials>
Details. This command opens port 8080 on the public VM server and forwards traffic back to your system to port 9000.
Note: I did not test the SSH command, but this should be correct. There are many examples on the Internet such as link. This answer will help you understand how traffic is routed (forwarded).
STEP 4)
Configure the application running on the Raspberry Pi to listen on port 9000 (example).
Summary, the client connects to VM port 80 which forwards to VM port 8080 which forwards over the SSH tunnel to the Raspberry Pi which has an application listening on port 9000.
Of course, you can change the port numbers, I used unique port numbers to prevent confusion.