Ask How can I configure Fast Reverse Proxy so that it redirects when attempting to access the domain name alone?

Brajet

Emerald
DOLLAR$
$15,213.97
Hi!
Sorry if my title doesn't make much sense, I'm a bit of a noob in IT ^^'

I am using frp (Fast Reverse Proxy) on a public server to expose a web service I am hosting at home. It works great, I can use my subdomain.domain.smth to reach that service.

Now when I try to access directly to domain.smth (without any subdomain) I get a page from the frp service telling that this is not configured, which is true. However I can't find how to setup redirection for the main domain, it seems that frp only works with subdomains. Have I missed something?

The ultimate goal would be to reach my service when using the subdomain, and get another service (typically a website) when accessing the domain alone. Is it possible?

Thanks for the help :)
 
The easiest way is to check your reverse proxy config file. Usually, you can set a rule that matches requests to your domain without any path (like example.com/) and then redirect them to the desired URL or internal server. Most reverse proxies, like Nginx or Apache, let you use server_name or host matches along with a return 301 or rewrite directive. This ensures anyone typing just the domain goes where you want.
 
The easiest way is to check your reverse proxy config file. Usually, you can set a rule that matches requests to your domain without any path (like example.com/) and then redirect them to the desired URL or internal server. Most reverse proxies, like Nginx or Apache, let you use server_name or host matches along with a return 301 or rewrite directive. This ensures anyone typing just the domain goes where you want.
Another approach is to set up a default server block. In Nginx, for example, you can make one block catch requests to the root domain and redirect to a specific location. That way, any request without a path gets redirected automatically. This is clean because it separates normal proxying from redirects, so you don't interfere with other subpaths or services on the same domain.
 
Hi!
Sorry if my title doesn't make much sense, I'm a bit of a noob in IT ^^'

I am using frp (Fast Reverse Proxy) on a public server to expose a web service I am hosting at home. It works great, I can use my subdomain.domain.smth to reach that service.

Now when I try to access directly to domain.smth (without any subdomain) I get a page from the frp service telling that this is not configured, which is true. However I can't find how to setup redirection for the main domain, it seems that frp only works with subdomains. Have I missed something?

The ultimate goal would be to reach my service when using the subdomain, and get another service (typically a website) when accessing the domain alone. Is it possible?

Thanks for the help :)
To set up FRP (Fast Reverse Proxy) to redirect the main domain to a different service, you can add a catch-all redirect rule in the configuration file.

In the "web" section of your FRP config, look for the following:

[web]
type = https
local_ip = your_home_ip
local_port = your_service_port
custom_domains = subdomain.domain.smth
default_uk = https://your_redirect_url
This will ensure that any requests to the base "domain.smth" (without a subdomain) will be redirected to the "your_redirect_url" of your choice, which could be a website or another service.

Keep in mind that this domain-level redirect will apply to any requests to the base domain, not just the subdomain you have configured for your home service. Make sure the "your_redirect_url" points to the desired destination.
 

RECOMMENDED COURSES

  • Group Coaching Program A-Z
    Group Coaching Program A-Z
    How to Design a Group Coaching Program That Expands Your Impact & Transforms Lives
    • BMF.io
    • Updated:
  • Affiliate Marketing A-Z
    Affiliate Marketing A-Z
    Affiliate marketing is when a merchant pays an affiliate for sales, clicks, or leads.
    • BMF.io
    • Updated:
  • Create an Online Course A-Z
    Create an Online Course A-Z
    Design, Develop, and Run Your Own Profitable & Engaging Online Training Program
    • BMF.io
    • Updated:
  • Digital Marketing A-Z
    Digital Marketing A-Z
    Digital marketing turns clicks into conversations—and conversations into loyal customers.
    • BMF.io
    • Updated:
  • Start a Freelance Business A-Z
    Start a Freelance Business A-Z
    Becoming a freelancer is one of the easiest and fastest ways to start your own business.
    • BMF.io
    • Updated:
  • Create a Membership Site A-Z
    Create a Membership Site A-Z
    Build and Run Subscription Websites for Reliable, Recurring Income
    • BMF.io
    • Updated:
Back
Top