Skip to content

fix: resolve NGINX redirect issue and related server bugs (#6)#26

Open
CodeAurelius0 wants to merge 1 commit into
muhsin-k:masterfrom
CodeAurelius0:master
Open

fix: resolve NGINX redirect issue and related server bugs (#6)#26
CodeAurelius0 wants to merge 1 commit into
muhsin-k:masterfrom
CodeAurelius0:master

Conversation

@CodeAurelius0

Copy link
Copy Markdown
  • nginx: replace broken 'rewrite...redirect' with proxy_pass so NGINX internally forwards short-code requests to Node (port 7000) instead of sending the browser a 302 to an unreachable internal port
  • nginx: add proxy headers (Host, X-Real-IP, X-Forwarded-For)
  • nginx/shortener_default.conf: add missing short-code proxy_pass block and remove stray trailing 'u' character
  • server/routes/urlshorten.js: fix undeclared 'shortUrl' variable
  • server/routes/urlshorten.js: wrap cache calls in try/catch so Redis failures do not crash requests
  • server/routes/urlshorten.js: add Redis cache check on GET redirect
  • server/services/cache.js: log Redis errors instead of silently ignoring
  • server/config/constants.js: change errorUrl to localhost for local dev

- nginx: replace broken 'rewrite...redirect' with proxy_pass so NGINX
  internally forwards short-code requests to Node (port 7000) instead
  of sending the browser a 302 to an unreachable internal port
- nginx: add proxy headers (Host, X-Real-IP, X-Forwarded-For)
- nginx/shortener_default.conf: add missing short-code proxy_pass block
  and remove stray trailing 'u' character
- server/routes/urlshorten.js: fix undeclared 'shortUrl' variable
- server/routes/urlshorten.js: wrap cache calls in try/catch so Redis
  failures do not crash requests
- server/routes/urlshorten.js: add Redis cache check on GET redirect
- server/services/cache.js: log Redis errors instead of silently ignoring
- server/config/constants.js: change errorUrl to localhost for local dev
@CodeAurelius0

Copy link
Copy Markdown
Author

your issue has been fixed now you can close the issue

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.

1 participant