Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header redirect/lobby variable port number #9940

Merged
merged 2 commits into from Dec 26, 2021

Conversation

DanVanAtta
Copy link
Member

Change Summary & Additional Notes

commit f68abbe

Nginx config to redirect to differing lobby depending on header version

Adds an NGINX config that checks the 'triplea-version' header value,
and based on that value redirects. To support running multiple servers
on the same host, we need to parameterize the lobby server to be able
to inject port number. The end goal is we can have multiple lobbies
running on the same host, different port numbers, and clients will
be redirected to the correct lobby based on version number in header.

commit 860ed08 (header-redirect/wip)

Nginx Config: remove deprecated ssl property

'sudo nginx -t' was generating this warning:

> nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/sites-enabled/default:21

Release Note

'sudo nginx -t' was generating this warning:

> nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/sites-enabled/default:21
Adds an NGINX config that checks the 'triplea-version' header value,
and based on that value redirects. To support running multiple servers
on the same host, we need to parameterize the lobby server to be able
to inject port number. The end goal is we can have multiple lobbies
running on the same host, different port numbers, and clients will
be redirected to the correct lobby based on version number in header.
proxy_read_timeout 90;

proxy_redirect https://localhost:443 https://localhost:8080;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 'proxy_redirect' line is seemingly unneeded. While testing, this line did not seem to matter.

@@ -15,7 +15,6 @@ server {
ssl_certificate {{ cert }}
ssl_certificate_key {{ cert_key }}

ssl on;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 'ssl on' directive is deprecated. This line listen 443 ssl http2; is enough to enable SSL

# Note: header names automatically have dashes converted to underscores.
# Headers containing underscores are ignored entirely!
lobby_proxy_pass: |
if ($http_triplea_version = "") {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'if' is evil in NGINX apparently: https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/

I tried a solution that used map to createa $lobbby_server variable - though that did not work at all for the websocket proxy_pass configurations.

@codecov
Copy link

codecov bot commented Dec 25, 2021

Codecov Report

Merging #9940 (f68abbe) into master (ac0381f) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #9940      +/-   ##
============================================
- Coverage     27.16%   27.15%   -0.01%     
  Complexity     7793     7793              
============================================
  Files          1207     1207              
  Lines         79186    79186              
  Branches      10891    10891              
============================================
- Hits          21507    21502       -5     
- Misses        55604    55608       +4     
- Partials       2075     2076       +1     
Impacted Files Coverage Δ
...rc/main/java/games/strategy/net/nio/NioWriter.java 79.16% <0.00%> (-4.17%) ⬇️
.../main/java/games/strategy/net/ClientMessenger.java 62.50% <0.00%> (-2.09%) ⬇️
.../src/main/java/games/strategy/net/nio/Decoder.java 75.86% <0.00%> (+1.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac0381f...f68abbe. Read the comment docs.

Copy link
Member

@RoiEXLab RoiEXLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, the progress you made there is very impressive

@DanVanAtta DanVanAtta merged commit d2c8565 into master Dec 26, 2021
@DanVanAtta DanVanAtta deleted the header-redirect/lobby-variable-port-number branch December 26, 2021 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants