The server has a proxy setup. Everything seems to be working fine. Server is listed too. Connecting to the game from the server list works without any issue. I say it’s working because the proxy/info.json, players.json, client and dynamic.json responds to 200 and throws the json information on the browser. In addition, accessing the domain directly (sub.domain.com) redirects to “https://cfx.re/join/**myservercode**”.
One thing to note too is the server is not using the default 30120 port.
The only problem is, when trying to connect through the console and typing “connect sub.domain.com”, it throws and error saying failed to connect sub.domain.com:30120 when in fact, 30120 is not the server port. In addition, it should not read as domain.com:30120 because the port I am using is already aligned with the domain. So using connect sub.doamin.com (without the port) should be the same as connect IPaddress:port
Hope this makes sense.
Figured out that
connect sub.domain.com and
connect https://sub.domain.com are different. The unsecured request puts the port at the end for some reason.
Should I change
proxy_pass http to
This actually depends on the scheme -
host.example will complete to
host.example:30120 (and lead to a HTTP request there), but
https://host.example/ will be passed verbatim.
I’ve submitted a pull request to the documentation to clarify this.
Thank you so much for responding. To provide you with a more detailed information about this. I’ll write them all below.
I’d go first with CF settings.
sub.domain.com A record to the proxy server IP address.
In addition to this, I have also enabled SSL Origin Authenticated Origin Pulls and SSL mode to “Strict”.
Origin Certificates are installed on the proxy server (cert and priv). I can confirm that the ssl certs are working as I can directly visit
sub.domain.com on the browser. Curl returns 200.
No additional settings were made and caching is set to standard.
On the proxy server, I have followed all instructions provided online, specifically
I can confirm that I was able to make this work as I am able to connect.
info.json, players.json, dynamic.json and client are accessible.
On the Fivem server side, server.cfg, I have this settings:
1.) When connecting through the default server list, user can connect when clicking on the “Connect” button however:
2.) Sometime (reported by several players), the “Connect” button is greyed out saying that the server is offline. This happens while other people are inside the game including me.
3.) When connecting through the console F8, the syntax has to be
connect https://sub.domain.com. User will be able to connect without any issue. Connecting without including the “https://” will throw an error stating "Unable to connect → sub.domain.com:30120.
Error states 30120 when server is using 30122. I’m so confused because typing the domain directly on the browser works like a charm. It will ask you to open Fivem then it will connect you automatically.
I will keep checking the thread and GitHub. Hopefully I can find a fix.
Hey, @BossKitz please check the issue at github https://github.com/citizenfx/fivem/issues/2280 and comment if the issue you are experiencing is the same.