3 ms·
I have a few (mostly silly ones): • Async/await in C# (I have a pretty good mental model and use it quite often but honestly have never truly understood how it
by isuckatcoding 9y ago
I have a few (mostly silly ones):
• Async/await in C# (I have a pretty good mental model and use it quite often but honestly have never truly understood how it compares to c/C++ threads)
• async concepts in Java Android. Runnable, future, asynctask, threads arrghhhh. My head hurts.
• multitable SQL joins (inner vs outer). Someone gave a pretty good explanation in the comments.
• why do I need to use nginx for my web server? And what is a reverse proxy anyways?
• how come I can use any smpt client or something like mailchimp or sendgrid to send an email and specify any email in the "from" field. Can't I pose as someone I'm not?
- imwally 9y agoI can answer your question on nginx. There are multiple reasons why you would want to use it as the entry point to what you want to serve. As a standalone web sever if offers a plethora of configuration settings that allow you to specify how you want to handle the incoming requests. TLS is one aspect that comes to mind. A certificate and key is not enough. You must specify the correct parameters such as the cipher suites, DH parameters, HSTS, and more if you want a secure connection. You mentioned a reverse proxy. This is the other aspect that comes to mind. Servers are bound to ports, like 80 and 443. How do you serve multiple applications on the same port on the same server? A proxy. More specifically a reverse proxy. It sits between the client and the services as a middleman to handle and direct requests. Multiple services can run on different ports but the reverse proxy allows for a single point of entry, such as HTTP requests on port 80. The proxy will inspect the request and based on certain values, say a hostname, it will be directed to the correct service. Otherwise you would have to tell your clients to specify the port the service is running on, ex: http://mydomain.com:8080 http://mydomain.com:8080
- mcrider 9y agoThis is incredibly useful for performance. If the user is requesting an image or other static asset, your reverse proxy can detect this and skip making a request to the actual application. Likewise if you want to go to some sort of cache based on the type of request.