Hello, I am just messing around with Ruby on the Rails, so I’ve installed simple app to learn from it, however it runs on domain:3000 port

How do I change it to open on just domain.com ?

thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Install a webserver and forward requests to port 3000.

Yeah, I have nginx, how do I forward it to 3000?

  • That is easy:

    “`sudo nano /etc/nginx/conf.d/virtual.conf

    Change it to :
    
    

    A virtual host using mix of IP-, name-, and port-based configuration

    server {
    listen 80;

    listen *:80;

    server_name  DOMAIN.COM;
    
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:PORT;
    }
    

    }

    Save and :
    
    ```sudo service nginx restart
    
Submit an Answer