Lily Wonhalf
Lily Wonhalf
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Lily Wonhalf on 10/18/2023 in #djs-questions
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!
4 replies