How do I setup a reverse proxy on Cloudflare?

Basically, I'm trying to convert http://149.56.67.129:25585 into https://svexpanded.com/ How would I do this?
36 Replies
DIVISION_Solar
DIVISION_Solar6mo ago
depending on the type of website you could use an nginx reverse proxy:
server {
listen 80 default_server;
client_max_body_size 100M;
server_name <your domain (optional)>;

location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80 default_server;
client_max_body_size 100M;
server_name <your domain (optional)>;

location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Beny
Beny6mo ago
Or workers:
fetch(request) {
const url = new URL(request.url)
url.host = "149.56.67.129:25585"
return fetch(url, request)
}
fetch(request) {
const url = new URL(request.url)
url.host = "149.56.67.129:25585"
return fetch(url, request)
}
Someone
Someone6mo ago
Is this possible going through just Cloudflare? I do not have the resources currently to setup a VPS and nginx reverse proxy
DIVISION_Solar
DIVISION_Solar6mo ago
you could use cf workers
Someone
Someone6mo ago
I'll test out this:
fetch(request) {
const url = new URL(request.url)
url.host = "149.56.67.129:25585"
return fetch(url, request)
}
fetch(request) {
const url = new URL(request.url)
url.host = "149.56.67.129:25585"
return fetch(url, request)
}
hm Could you expand on that a bit more? Not quite sure what you mean hahaha
RyanKnack
RyanKnack6mo ago
Do you have access to the domain name you bought Add that domain name to CloudFlare https://dash.cloudflare.com/?to=/:account/add-site
Someone
Someone6mo ago
Already added, yes
RyanKnack
RyanKnack6mo ago
Do you have the DNS records set up for proxying? Type: A Name: @ Target: 149.56.67.129
Someone
Someone6mo ago
Yes, that has been added
RyanKnack
RyanKnack6mo ago
So now you need to overwrite the port from 80 (HTTP)/443 (HTTPS) to your specified port (25585) Under rules > origin rules > new Should be "all Incoming requests" then "overwrite to 25585"
Someone
Someone6mo ago
@RyanKnack
No description
Someone
Someone6mo ago
Just did it. Doesn't appear to be working quite yet- could it take some time? ohhh i see i needed to proxy the A record
RyanKnack
RyanKnack6mo ago
I think you may need to configure the DNS on your server side as well Can I see your DNS entries
Someone
Someone6mo ago
I had it on DNS only, Proxied works :D
No description
RyanKnack
RyanKnack6mo ago
Ooh so it works now? Ayyy works on my end as well
Want results from more Discord servers?
Add your server