Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Install Nginx on Ubuntu (AWS EC2): Start It, Enable It, Check It

My Node app runs on port 4000. That means anyone who opens it has to type :4000 at the end of the URL. Real sites don't work like that. The fix is to put a web server in front of the app. In this post I install Nginx on my Ubuntu EC2 server and make sure it stays running. In the next post I point it at the Node app. This is part of my series on deploying a Node.js app to AWS. So far I have an EC2…

To deploy a Node.js application on AWS EC2, you'll need to install and configure a web server like Nginx. Here's how to do it:

1. Connect to your Ubuntu EC2 instance via SSH. Once connected, install Nginx by running the command `sudo apt install -y nginx`. The `-y` flag automatically answers "yes" to any prompts.

2. Start the Nginx service using `sudo systemctl start nginx`. This command initiates the web server right away.

3. To ensure Nginx starts automatically after a server reboot, enable it with `sudo systemctl enable nginx`. This step is crucial, as without it, Nginx will be off after each reboot, leaving your site inaccessible.

4. Verify that Nginx is running by executing `sudo systemctl status nginx`. Look for "active (running)" in green text. If it's not active, there may be an issue with the installation or configuration.

5. Open a web browser and enter your server's public IP address. You should see the familiar "Welcome to nginx!" page, confirming that Nginx is up and running.

Now, Nginx is serving as your web server, but it needs to know about your Node.js application. In the next step, you'll configure Nginx as a reverse proxy, directing traffic on port 80 to your app running on port 4000.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Why We Built an RMM Priced Per Device, From $0.50

If you've ever shopped for RMM (remote monitoring and management) software as a one-person IT shop, you've probably had the same experience: every vendor wants to talk about "per-technician pricing,"…

  • OniConnect offers per-device pricing starting at $0.50 per device per month.
  • Designed for solo admins and small MSPs managing 20-500 endpoints.
  • Transparent pricing eliminates need for sales calls or demos.

JDBC Mapping Without Reflection: Up to 117 Faster Than Spring JDBC

SQL execution isn't the only cost of a database query. Turning a ResultSet into Java objects costs time and memory, too. What if we generated the mapping code at compile time instead?

  • SJF4J generates mapping code at compile time, 117 times faster than Spring JDBC
  • Uses @CompiledJdbcMapper annotation for compile-time code generation
  • Allocated 50 times less memory than Spring's DataClassRowMapper

Pattern Matching on Spans and UTF-8 Literals in C# 15 / .NET 11

High-throughput network parsers (Kestrel, custom TCP, Kafka consumers) read wire data as ReadOnlySpan . Historically, running a clean switch statement on headers or commands required either string…

  • C# 15 introduces direct switch pattern matching on byte spans
  • Eliminates zero allocations and Gen0 garbage collection pressure
  • Improves code readability with idiomatic pattern matching syntax

More from Tuesday, 1 December 2026 →