Skip to content

Commit

Permalink
Make it reverse-proxy-friendlier
Browse files Browse the repository at this point in the history
  • Loading branch information
RubberDuckShobe committed Sep 1, 2023
1 parent dc5d68b commit 17eee23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/wavebreaker_config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"logger": true,
"port": 5000,
"host": "0.0.0.0",
"reverseProxy": true,
"useHttps": false,
"https": {
"key": "./key.pem",
Expand Down
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const logger = {
};

const fastify = Fastify({
trustProxy: WavebreakerConfig.reverseProxy,
...logger,
//For HTTPS in production, please use nginx or whatever
...(process.env.NODE_ENV == "development" &&
Expand Down Expand Up @@ -125,4 +126,4 @@ fastify.register(apiServerRouter);
fastify.register(apiScoresRouter);
fastify.register(apiSongsRouter);
fastify.register(apiShoutsRouter);
fastify.register(apiRankingsRouter);
fastify.register(apiRankingsRouter);

0 comments on commit 17eee23

Please sign in to comment.