S
S
Stepan2020-09-25 14:25:58
linux
Stepan, 2020-09-25 14:25:58

How to change url to url with port?

There is an application on Node Js that listens, for example, on port 8080. But in order to get there, you need to go to the address: site.ru:8080 Is it possible to do something so that when you go to site.ru/port, the server thinks that the address is actually site.ru:8080 ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
ComodoHacker, 2020-09-25
@ComodoHacker

301 redirect, for example.
But the 80th port should be someone to listen.

A
alex1478, 2020-09-25
@alex1478

You need to set up nginx or apache2 in reverse proxy mode.
Simple example for nginx:

location ^~ /8080/ {
                proxy_pass         http://127.0.0.1:8080/;
                proxy_redirect     default;
        }

P
pfg21, 2020-09-25
@pfg21

option 2: proxying by means of a web server. see the documentation for the web server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question