I've just downloaded NGINX for Windows and I'm struggeling a bit.
It's up and running with my index file showing at 127.0.0.1:8080, but I'm having problems with connection my web server to my domain.
From what I understand from the documentation I've read online, I had to change the DNS properties at my registrar like this (target-IP is my public IP):
Here is my nginx.conf file:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name erikbugge.no www.erikbugge.no;
location / {
root www;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root www;
}
}
}
I have also port-forwarded port 8080 to my local IP address in my router.
The problem now is that whenever I'm trying to access my webpage www.erikbugge.no it simply redirects me to my public IP address.
I'm pretty sure I'm doing something wrong, but I have no idea what it is.
Please be gentle, I'm new to this web server stuff.
Related
I have an angular application (say admin app) running at port 4200 in my windows machine. My Nginx is running at port 8080. When request is coming at Nginx I am forwarding it to my angular application (admin app, port 4200) but in that case Js and Css files are not rendered for the admin app and showing 404 error for all css/js files.
My operating System is windows 10
Here is my configuration at nginx.conf file:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080 ;
server_name localhost;
location /admin {
proxy_pass http://localhost:4200/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
here is the error picture
Edit : Here's my ufw status:
Status: active
To Action From
-- ------ ----
80 ALLOW Anywhere
1935 ALLOW Anywhere
80 (v6) ALLOW Anywhere (v6)
1935 (v6) ALLOW Anywhere (v6)
And App List:
Available applications:
CUPS
So, I tweaked with DJI Phantom 4 Pro+ and discovered that it support custom stream platform. My question is how to do it? I can already create NginX RTMP server but I still can't figure out how to make the Drone connect and stream to it. I already test my server using OBS to http://{IP}/live with key test and open it using VLC (on my phone) at rtmp://{IP}/live/test. Here's my nginx conf:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 192.168.0.39:80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
rtmp {
server {
listen 192.168.0.39:1935;
chunk_size 4096;
application live {
live on;
record off;
}
}
}
It turns out I'm just stupid. To anyone who has the same issue, don't make the same mistake as I did. I enter rtmp://{IP}/live/drone/. It should be rtmp://{IP}/live/drone (notice the missing "/")
My apologies if the title isn't descriptive, I wasn't sure how to word this. I need to connect to a VPN, and need a specific IP address to do it. I was wanting to use Nginx configured as proxy server to do this. Here is my Nginx config file:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 8080;
server_name name;
location / {
resolver 8.8.8.8;
proxy_pass http://$http_host$uri$is_args$args;
proxy_bind 10.0.0.13;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
I had thought I could achieve what I wanted with proxy_bind, but whenever I try to connect to a website I am given an Nginx error page. I checked the error log, and I get an error saying it couldn't assign the address. I don't even know if that's actually what I want to do. Any suggestions? Thanks in advance.
I've installed nginx and set it up as a forward proxy (see attached nginx.conf)
The server became overloaded and it seems like someone else was using it.
is there a way to limit the nginx proxy to receive request only from specific ips?
Please explain how I should change the nginx.conf to do it for ip 123.456.123.345
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 8080;
location / {
resolver 8.8.8.8;
proxy_pass http://$http_host$uri$is_args$args;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Do it like this:
location / {
allow 123.456.123.345;
deny all;
resolver 8.8.8.8;
proxy_pass http://$http_host$uri$is_args$args;
}
From the docs:
The rules are checked in sequence until the first match is found.
So if IP equals 123.456.123.345, access will be allowed, otherwise - denied.
If you want to allow multiple IPs, you can specify them before deny all;:
allow 123.456.123.345;
allow 345.123.456.123;
deny all;
"location" directive should be inside a 'server' directive
I am trying to setup rhodecode + redmine on ubuntu with the following
configuration
http://my_ip/redmine
and
http://my_ip/rhodecode
I am using nginx as the web server with redmine running on localhost:3000
and rhodecode running on localhost:5000, somehow iam missing the point in
configuring nginx.conf
I am able to redirect both redmine on port 3000( while testing with webrick) and rhodecode on port 5000 individually but not able to set them as
http://my_ip/redmine
and
http://my_ip/rhodecode
Following is my nginx.conf file
worker_processes 1;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ruby-1.9.3-p374/gems/passenger-3.0.19;
passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.3-p374/ruby;
upstream rhodecode {
server 127.0.0.1:5000;
}
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root /var/data/redmine/public;
passenger_enabled on;
client_max_body_size 25m; # Max attachemnt size
location /rhodecode/ {
try_files $uri #rhodecode;
proxy_pass http://127.0.0.1:5000;
}
location /rhodecode {
proxy_pass http://127.0.0.1:5000;
}
}
}
It will be easier to make subdomains redmine.yousite.com and rhodecode.yoursite.com. It's also prettier and more agile - you can easily move one of the apps to another server.