PhlexPlexico / G5V

A front-end for G5API to manage matches/seasons/tournaments for CS:GO
MIT License
56 stars 29 forks source link

[BUG] Invalid Host Header #24

Closed PhlexPlexico closed 3 years ago

PhlexPlexico commented 4 years ago

@xe1os if it's an issue with G5V please post it here, thanks :)

@PhlexPlexico what needs to be updated in the G5API config as i'm getting Invalid Host Header if i am trying to open G5V panel using sub domain.

Below are the details updated in development.config

https://user-images.githubusercontent.com/39219862/97667992-18a10b00-1aa7-11eb-9524-71556f64732f.png

"hostname": "http://g5v.xe1os.com", "clientHome": "http://localhost:8080", "apiURL": "http://localhost:8080/api/"

Are these details proper? Do i need to update anything in G5V vue.config.js??

I basically want to make it work like yours http://phlex.avidgamers.me:8080/

PhlexPlexico commented 4 years ago

So, a few things in regards to the setup in the G5API:

1) Make sure you have a secure session key. That is used for storing sessions in the redis instance you have running. This is to ensure no one can just send fake requests and high-jack a session. 2) May wanna cover the db key or redo it as well, just in case. 3) Main problem for this is your apiURL. If you're setting this up to run G5V on a subdomain, you need change that API url to:
"apiURL": "http://g5v.xe1os.com/api/"
This is because G5V has a reverse proxy in the vue webpack which points back to the API locally. This is mainly for match setup and sending configs to a CS:GO server. But your problem doesn't lie here and I've been meaning to make this change to the vue.config.js file. The current setup I have is mainly for dev, but I believe the new following change can work.

Under devServer, you need to add an additional option since you are technically trying to connect outside of the localhost. So, add the following to your config:

public: "g5v.xe1os.com:80",

This should resolve the issue after it reloads.

PhlexPlexico commented 3 years ago

Since I've put the value in the vue.config.js I'm going to close this, it's under the value PLEASECHANGEME. Just change it to your public facing URL and you should be off to the races.

xe1os commented 3 years ago

@PhlexPlexico Thank you! It is working now :)