Proxying the API

Hayo, I would like to proxy the Discord API so that I can analyze what endpoints I call the most, as well as other data like the response codes I get and stuff. I setup a basic nginx vhost on my computer but it doesn't seem to be working well, and I think the problem is I don't really know what I'm doing lol. If any of you already did that or knows how to do that, could you please give me advice on how I could configure my nginx so it works properly? All I want is for the connection to Discord API to go through a lil nginx vhost on the local machine before going to Discord servers. Here's what I have so far:
server {
listen 80;
server_name discord.local discord.com;

access_log D:\\Programs\\nginx\\logs\\discord.local-access.log;
error_log D:\\Programs\\nginx\\logs\\discord.local-error.log;

location / {
#proxy_set_header X-Forwarded-For $remote_addr;
#proxy_set_header Host $http_host;
proxy_pass https://discord.com;
}
}
server {
listen 80;
server_name discord.local discord.com;

access_log D:\\Programs\\nginx\\logs\\discord.local-access.log;
error_log D:\\Programs\\nginx\\logs\\discord.local-error.log;

location / {
#proxy_set_header X-Forwarded-For $remote_addr;
#proxy_set_header Host $http_host;
proxy_pass https://discord.com;
}
}
With discord.local, it gives me an error 421 With discord.com it simply does not respond. Thank you!
3 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Lily Wonhalf
Lily WonhalfOP15mo ago
le gasp I will take a look into that thank you!!!
JeffLegendPower
JeffLegendPower15mo ago
i clicked on your profile and my computer nearly crashed
Want results from more Discord servers?
Add your server