Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If you need a server for a personal project, maybe caddy would be better for you.
-
#config for webserver with no virtual hosts or for default server
server {
listen 80; #port config
index index.php index.html index.htm; # what files act like index
server_name _; #server name (url)
root /var/www/html; # directory with files
location / { # any route starting with /
try_files $uri $uri/ =404; # tries to load file else bad gateway
}
}
# config for virtual host web.name
server {
listen 80; #port config
index index.php index.html index.htm; # what files act like index
server_name web.name; #server name (url)
root /var/www/html; # directory with files
location / { # any route starting with /
try_files $uri $uri/ =404; # tries to load file else bad gateway
}
} -
@rootshell
# simple reverse proxy for web.name
server {
listen 80; #port config
server_name web.name; #server name (url)
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# headers aren't needed but they pass the IP and hostname to the other servet
proxy_pass http://localhost:8080; # sends all traffic to and dns/ip address on specified port.
}
}
See. Unless you are doing some evil shit it's not that hard. 😁
Related Rants
configuring nginx is like trying anal for the first time
joke/meme
web
aws
nginx