Quantcast
Channel: Nginx Forum - How to...
Viewing all 2931 articles
Browse latest View live

Can use different certificates on backends, each with a different server_name (no replies)

$
0
0
I currently have one load balancer and four backends server configured to proxy_pass several subdomains under one domain using https protocol.
The ssl certificate for this domains are all defined on the Load balancer and the backend server. I believe the load balancer is the one serving the certificate due to the fact that once i remove certificates entries from it my sites stops working.

Currently the system is working fine my challenge now is that I need to add another domain with its own certificate. My nginx.conf on the loader balancer where I declared upstream servers does not allow me to add another block. The moment I try adding the block I get errors. I have attached my nginx.conf of the load balancer.

I have configured ssl for the new domain on the backends but the moment I browse the domain it gets the certificate of the first domain possible becoz its not declared on the load balancer. My question is how can achieve this scenario. I have attached my nginx.conf the commented lines indicate lines which were making nginx fail.

I am still a learning Nginx if you can kindly check my configures and assist.

CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. (no replies)

$
0
0
Here is the code:

location ~ \.php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME /var/www/test/public$fastcgi_script_name;

#CORS SETTINGS
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS, DELETE';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-
Control,Content-Type,Content-Range,Range,Authorization';
}


ERROR
invalid number of arguments in "add_header"

CAUSE
add_header 'Access-Control-Allow-Origin' '*' always;
when I do add the word "always"

CORS errors when hosting MathJax (no replies)

$
0
0
I am trying to host MathJax on our location network (IP 10.0.x.y, no hostname) using the following nginx config:

server {
listen 80;
server_name _;

location ~* \.(ttf|ttc|otf|eot|woff|font.css)$ {
add_header "Access-Control-Allow-Origin" "*";
expires 1M;
add_header Cache-Control "public";
}

location /misc/ {

root /var/www/html/;
}
}

I am getting a lot

Access to font at 'http://10.0.x.y/misc/MathJax-2.7.5/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff?V=2.7.5' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
10.0.x.y/misc/MathJax-2.7.5/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff?V=2.7.5:1 GET http://10.0.x.y/misc/MathJax-2.7.5/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff?V=2.7.5 net::ERR_FAILED

errors in chrome.

How to correctly allow access to these fonts?


P.S.: I am using nginx/1.10.3

Subdomain configuration with Letsencryt wildcard TLS (no replies)

$
0
0
What I want to do ?

I have two application on local ports and I want to access them like that :
- maindomain.com -> node.js app
- sub.maindomain.com -> .net core app


My DNS config
- maindomain.com (A Record) 11.111.11.111
- sub.maindomain.com (A Record) 11.111.11.111


Nginx config

> /etc/nginx/sites-enabled/maindomain.com (linked from ./sites-available/)

upstream node_app{
# node.js running
server 127.0.0.1:8000;
}

server{
listen 80;
server_name www.maindomain.com maindomain.com;
#Redirige toutes les requêtes http vers https
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/maindomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/maindomain.com/privkey.pem;

location / {
include proxy_params;
proxy_pass http://node_app;
}
}


> /etc/nginx/sites-enabled/sub.maindomain.com (linked from /sites-available/)

upstream core_api{
# Asp.net core API running in background
server 127.0.0.1:5000;
}

server{
listen 80;
server_name www.sub.maindomain.com sub.maindomain.com;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/maindomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/maindomain.com/privkey.pem;

location / {
include proxy_params;
proxy_pass http://core_api;
}
}


Result :

After that, I have restarted my nginx service.
Requests on sub.maindomain.com just redirect on maindomain.com.

What did I missed ?

Unable to execute mysql group by query (no replies)

$
0
0
Scenario : in order to group the records with same ID , I tried using group by query but eventually it isn't getting executed.

I don't see any error message, but the query fails to execute with blank.

Query :

SELECT COUNT (customerID), Country FROM Customers GROUP BY Country;

but on Apache , i dont see this issue. please help as this is impacting our production


i have also posted in Stackeoverflow.
https://stackoverflow.com/questions/57583647/unable-to-execute-mysql-group-by-query

Why isn't Nginx distributing traffic as a load balancer in a Docker container? (no replies)

$
0
0
I have Nginx v.1.17.3 running in a Docker container to act as a load balancer. While I have gotten it to work in the past with a different version, I have not done it recently with this version. The default.conf file of this Nginx instance has the following content:

server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;

location / {
#root /usr/share/nginx/html;
#index index.html index.htm;
proxy_pass http://backend;
proxy_next_upstream error http_502;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

upstream backend {
server 0.0.0.0:814;
server 0.0.0.0:815;
server 0.0.0.0:816;
}

# End of file


I have Nginx running in containers on ports 814, 815 and 816 respectively.

I can bypass the Nginx load balancer with the port numbers. I want the load balancer to receive all the traffic and distribute it. But when I go to the load balancer via a web user interface, I see this:

An error occurred. Sorry, the page you are looking for is currently unavailable. Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx.

When I run "docker ps -a" I see this for the load balancing container:

3ba2bc42d377 nginx "nginx -g 'daemon ..." 24 minutes ago Up 6 minutes 0.0.0.0:80->80/tcp
docker-nginxbalancer8

Does anyone know why it is not distributing traffic and just giving me this error? You would think that the container would not start if there was a significant problem. The image created other containers that work fine. I tried using 127.0.0.1 instead of 0.0.0.0. But the problem was exactly the same. The Docker container has Nginx access logs being sent to standard output and Nginx error logs being sent to standard error. Therefore I cannot figure out what is wrong.

Permit access on the base of HTTP value header or IP address (no replies)

$
0
0
Hi,

i would like to implement restriction on the base of specific value in http header (currently implemented and it works) or specific IP address. So if the traffic has specific http header value OR if the traffic is coming from specific IP address the traffic should be permitted the other traffic should be denied. How to add OR rule for IP addresses?

Current config is something like following:

upstream www_domain {
server origin:443 resolve;
zone upstream_backend 256k;
}

server {
listen 80;
server_name www.domain.com;
access_log /var/log/nginx/access.log main;
proxy_pass_header Server;

location / {
access_by_lua 'validate_nginx(3, "xyz", 30)';
proxy_pass https://www_domain;
proxy_set_header Host $server_name;
real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
}
}

Thanks,

Oblack

Nginx reverse proxy not working to Shiny Server hosted on AWS Lightsail Instance (no replies)

$
0
0
Hi there,

I've posted this on Stack Overflow and hoping someone can help me here.

I am new to nginx and am trying to configure a reverse proxy to a Shiny Server (Open) that I have successfully implemented on an AWS Lightsail Instance. I am desperate at this point and would appreciate any advice. Here are the pertinent configuration arrangements.

Note that I have a purchased a custom domain from GoDaddy. Assume this is named mydomain.com.au. However, I have changed the name servers to point to Netlify as I deployed my website through the blogdown R package in Netlify.
Lightsail Instance Details

This has a Shiny Server installed and a static IP address assigned. Assume 123.45.67.89 from this point onwards. The firewall details are provided below:

Lightsail instance firewall details

I can successfully access the Shiny Server via http://123.45.67.89:3838 and associated Shiny apps I've deployed. I have a DNS Zone record added in order to link mydomain.com.au to my Shiny Server on the Lightsail instance - see details below:

Record Type: A
Subdomain: shiny.mydomain.com.au
Resolves to: 123.45.67.89 (i.e. static IP address)

Netlify details

I have a DNS record added in Netlify for mydomain.com.au which points to the Lightsail instance static IP address. Below are the details (I'm not sure whether I need a DNS record in Netlify and Lightsail though). Note this this is SSL/TLS certificate enabled and cannot be disabled (it will automatically revert to "https://" even when "http://" is specified).

Name: shiny.mydomain.com.au
TTL: 3600 seconds
Type: A
Value: 123.45.67.89

nginx details

Below are the relevant details of the /etc/nginx/sites-enabled/default file which I modified based on the instructions from this post. The $http_upgrade and $connection_upgrade is stored in the /etc/nginx/nginx.conf file. There is no SSL/TLS certificate from certbot added and I'm not sure whether this is an issue.

server {
listen [::]:80 default_server;

root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;

server_name shiny.mydomain.com.au;

# Reverse proxy to port 3838
location / {
proxy_pass http://localhost:3838/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 20d;
proxy_buffering off;

# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
}

The nginx configuration test appears to be successful:

sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

The following firewall profiles (from sudo ufw status) are set up - Nginx HTTP, OpenSSH, 3838 and 80. nginx is active and running too with no issues according to sudo service nginx status.
What works?

http://123.45.67.89:3838/ successfully opens the Shiny Server index page.
https://shiny.mydomain.com.au:3838/ successfully opens the Shiny Server index page.

Other information?

Visiting https://shiny.mydomain.com.au:3838 will automatically attempt https://123.45.67.89:443 which ultimately fails and times out. The redirection to 123.45.67.89 appears to work but it does not forward to the 3838 port. Firefox Network monitoring indicates that the Server is nginx.

What might be happening?

At this point (and I am very new to web administration), I think this might be an issue with Netlify forcing HTTPS which cannot be redirect to the Shiny Server port (HTTP?). However, visiting https://shiny.mydomain.com.au:3838 successfully redirects to the Shiny Server index page. I just can't understand why nginx isn't successfully forwarding to the 3838 port without specifying it in the URL based on the default configuration file.
What is the problem?

Loading shiny.mydomain.com.au does not successfully load the Shiny Server index page. It will eventually time out and no page is loaded ("The connection has timed out"). Checking the network monitoring information in Firefox indicates that tries to access 123.45.67.89 but not 123.45.67.89:3838 (i.e. the Shiny Server). It doesn't appear that it is redirecting at all according to the /etc/nginx/sites-enabled/default file.

I have tried changing localhost to 127.0.0.1 to no avail. I have tried following Dean Attali's post and another recent post on setting up Shiny Server too but still no success.

Can someone please help me out on how to get nginx as a reverse proxy to work?

I'm really running out of ideas here. Thanks.

Nginx stops sending request body when upstream server consuming body while returning data (no replies)

$
0
0
Hi there,

I use Nginx as a reverse proxy. My client sends 20M data to Nginx, and Nginx received all of them (I can view 20M file in /var/lib/nginx). But when Nginx tries to proxy the 20M data to upstream server, only half of them are sent. My server's function is reading a file while returning the encoded file. Server starts to reply before it receives all of the request body for efficiency purpose.

The debug_log shows: writev() not ready (11: Resource temporarily unavailable) while writing to upstream server
Following log is where Nginx stops sending data to upstream server:
2019/09/09 11:02:47 [debug] 15570#0: *1 http body new buf t:1 f:0 00005654FB2DE420, pos 00005654FB2DE420, size: 8192 file: 0, size: 0
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer buf fl:1 s:8192
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer in: 00005654FB28D800
2019/09/09 11:02:47 [debug] 15570#0: *1 writev: 8192 of 8192
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer out: 0000000000000000
2019/09/09 11:02:47 [debug] 15570#0: *1 http read client request body
2019/09/09 11:02:47 [debug] 15570#0: *1 recv: eof:0, avail:1
2019/09/09 11:02:47 [debug] 15570#0: *1 recv: fd:3 8192 of 8192
2019/09/09 11:02:47 [debug] 15570#0: *1 http client request body recv 8192
2019/09/09 11:02:47 [debug] 15570#0: *1 http body new buf t:1 f:0 00005654FB2DE420, pos 00005654FB2DE420, size: 8192 file: 0, size: 0
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer buf fl:1 s:8192
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer in: 00005654FB28D800
2019/09/09 11:02:47 [debug] 15570#0: *1 writev: 8192 of 8192
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer out: 0000000000000000
2019/09/09 11:02:47 [debug] 15570#0: *1 http read client request body
2019/09/09 11:02:47 [debug] 15570#0: *1 recv: eof:0, avail:1
2019/09/09 11:02:47 [debug] 15570#0: *1 recv: fd:3 8192 of 8192
2019/09/09 11:02:47 [debug] 15570#0: *1 http client request body recv 8192
2019/09/09 11:02:47 [debug] 15570#0: *1 http body new buf t:1 f:0 00005654FB2DE420, pos 00005654FB2DE420, size: 8192 file: 0, size: 0
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer buf fl:1 s:8192
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer in: 00005654FB28D800
2019/09/09 11:02:47 [debug] 15570#0: *1 writev: 4800 of 8192
2019/09/09 11:02:47 [debug] 15570#0: *1 writev: -1 of 3392
2019/09/09 11:02:47 [debug] 15570#0: *1 writev() not ready (11: Resource temporarily unavailable)
2019/09/09 11:02:47 [debug] 15570#0: *1 chain writer out: 00005654FB28D800
2019/09/09 11:02:47 [debug] 15570#0: *1 http read client request body
2019/09/09 11:02:47 [debug] 15570#0: *1 event timer del: 10: 1044869538
2019/09/09 11:02:47 [debug] 15570#0: *1 event timer add: 10: 60000:1044879558
2019/09/09 11:02:47 [debug] 15570#0: timer delta: 9736
2019/09/09 11:02:47 [debug] 15570#0: worker cycle
2019/09/09 11:02:47 [debug] 15570#0: epoll timer: 60000
2019/09/09 11:02:47 [debug] 15570#0: epoll: fd:3 ev:0005 d:00007FD0DDF9C1E0
2019/09/09 11:02:47 [debug] 15570#0: *1 http run request: "/dbsec/encodeData?"
2019/09/09 11:02:47 [debug] 15570#0: *1 http upstream read request handler
2019/09/09 11:02:47 [debug] 15570#0: *1 http upstream send request
2019/09/09 11:02:47 [debug] 15570#0: *1 http upstream send request body
2019/09/09 11:02:47 [debug] 15570#0: *1 http read client request body
2019/09/09 11:02:47 [debug] 15570#0: *1 event timer: 10, old: 1044879558, new: 1044879622
2019/09/09 11:02:47 [debug] 15570#0: *1 http run request: "/dbsec/encodeData?"
2019/09/09 11:02:47 [debug] 15570#0: *1 http upstream check client, write event:1, "/dbsec/encodeData"
2019/09/09 11:02:47 [debug] 15570#0: epoll: fd:10 ev:0001 d:00007FD0DDF9C2C8
2019/09/09 11:02:47 [debug] 15570#0: *1 http upstream request: "/dbsec/encodeData?"
2019/09/09 11:02:47 [debug] 15570#0: *1 http upstream process header
2019/09/09 11:02:47 [debug] 15570#0: *1 malloc: 00005654FB28DE80:4096
2019/09/09 11:02:47 [debug] 15570#0: *1 recv: eof:0, avail:1
2019/09/09 11:02:47 [debug] 15570#0: *1 recv: fd:10 4096 of 4096
2019/09/09 11:02:47 [debug] 15570#0: *1 http proxy status 200 "200 OK"
2019/09/09 11:02:47 [debug] 15570#0: *1 http proxy header: "Date: Mon, 09 Sep 2019 15:02:37 GMT"
2019/09/09 11:02:47 [debug] 15570#0: *1 http proxy header: "Content-Type: application/octet-stream"
2019/09/09 11:02:47 [debug] 15570#0: *1 http proxy header: "Transfer-Encoding: chunked"
2019/09/09 11:02:47 [debug] 15570#0: *1 http proxy header: "Server: Jetty(9.4.8.v20171121)"
2019/09/09 11:02:47 [debug] 15570#0: *1 http proxy header done
2019/09/09 11:02:47 [debug] 15570#0: *1 HTTP/1.1 200 OK
Server: nginx/1.16.1
Date: Mon, 09 Sep 2019 15:02:47 GMT
Content-Type: application/octet-stream
Transfer-Encoding: chunked
Connection: keep-alive


Does someone know what happens here and why write stops? Thanks in advance!

How to install a nginx-only domain in a server running Vesta (apache + nginx)? (no replies)

$
0
0
Hi I have a Cloud Server in a local hosting company with Ubuntu Server 18.04 installed. I've already successfully installed Vesta Control Panel with these settings:

Web: nginx + apache
FTP: vsftpd
Mail: exim + dovecot + spamassasin + clamav
DNS: named
Firewall: iptables + fail2ban
Softaculous: Yes
DB: MySql + PostreSQL
I succesfully added three domains via Vesta CP user interface and configured them properly. I used this setup because these three sites use Wordpress, so installing wordpress solely with nginx is quite complicated, but using apache + nginx works pretty well.

Now I want to know if I can install another domain/site that does work only in nginx, because I then need to configure guinorn to run a Python/Django web app (ass opossed to the other 3 domains where I use wordpress).

I tried this steps: went to /etc/nginx/conf.d and added a mydomain.com.conf file with these settings:

server {
listen 80;
listen [::]:80;

root /var/www/gero.com.ar/public_html;

index index.html;

server_name gero.com.ar www.gero.com.ar;

access_log /var/log/nginx/gero.com.ar.access.log;
error_log /var/log/nginx/gero.com.ar.error.log;

location / {
try_files $uri $uri/ =404;
}
}


Then restarted both nginx and apache services, but it didn't work. When I enter gero.com.ar, it goes to the vesta default domain.

Is there a way to do this? Do you know any tutorials/guides that accomplish something different?

In case the text is unclear or my approach is not correct: What I want to accomplish one way or the other is to have 4 domains in my server. One running a django app and the other three running wordpress. I already did the wordpress part, trying to figure out the django part now.

Thanks in advance

NGINX/RTMP/HLS (no replies)

$
0
0
Hello! We are a school, trying to move away from our old coax system for live video announcements. I came across NGINX using OBS early this year, and we are trying it out.

For the most part, it's working great but we have many teachers saying it freezes and they have to refresh the site to resume video. I am in IT here but know nothing about NGINX. I found a repackaged drag and drop that had HLS already (we want teachers to watch via a browser) but it's an older version 1.7.11.3, I do not know if that would be the cause?

I am hoping someone can help us out send some pointer to try and clean up the freezing?

Thanks in advance

I have attached the config file I am using. Most of it is stock from the package I found. We are using a Windows 10 laptop for NGINX and OBS

switching nginx-apache to using SSL (no replies)

$
0
0
I am having web-site nginx port 80 with proxy_pass http://10.7.1.3:80 to apache port 80
how to switch all this to 443 port with using SSL certificate?
when i make config for SSL certificate working with nginx 443 it is ok but web-site on apache 443 port is not seen

How to do this right way?

should i use streams
Please give example for configuring

Is it config would work 443 port nginx to 443 apache
where should i place certificates

Appreciate any help
You have a great stuff made (mean nginx)

latest version for raspberry pi. (no replies)

$
0
0
Given that i would need 1.15.2 to enable brotli is there any way to manually compile the latest version for my rpi and compile the brotli module among the standard default modules?

nginx proxy_pass https (1 reply)

$
0
0
hello
i would like to configure my nginx server to be able to make cache via https in direction of a apache server with DNS name but i think it makes only redirection and cache doesnt work

my configuration is
nginx :10.105.56.1 nginx.com in front
apache :10.105.56.2 website.com in back

when i put nginx.com ,he makes the redirection but its website.com that appear in the url , dont know if normal and if cache works
here a part of my configuration of nginx.conf

nginx.conf listen on 8080
servername localhost

my proxy.conf file

server {
listen 80;
server_name nginx.com;
location / {
proxy_pass https://website.com;
}
}
server {
listen 443;

server_name nginx.com;
#auth_basic "Restricted Access";
#auth_basic_user_file /etc/nginx/htpasswd.users;
ssl on;
ssl_certificate /etc/nginx/nginx.com.pem;
ssl_certificate_key /etc/nginx/nginx.com.pkey;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass https://website.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_valid 301 1m; # Cache permanent redirects for a whole year
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
resolver website.com;
}
}



thanks for help :)

Nginx rewrite not working as expected (no replies)

$
0
0
Here directories structure
http://localhost -> /usr/local/nginx/web/webroot
http://localhost/sess8283737/wordpress -> /usr/local/nginx/wordpress
http://localhost/sess244737/phpmyadmin-> /usr/local/nginx/phpmyadmin


I have below block, it works fine with index.html, but does not work when actual php files
when user visits http://localhost/sess8283737/wordpress and I want nginx to load files from /usr/local/nginx/wordpress
and set sess8283737 as variable

server {
listen 80;
server_name localhost;
root /usr/local/nginx/web/webroot;

location / {
root /usr/local/nginx;
if ($uri ~ "^/sess([a-z0-9]+)/(wordpress)") {
rewrite ^/sess([a-z0-9]+)/wordpress /wordpress/$2;
}

if ($uri ~ "^/sess([a-z0-9]+)/(phpmyadmin)") {
rewrite ^/sess([a-z0-9]+)/phpmyadmin /phpmyadmin/$2;
}

location \.php$ {
if ($uri ~ "^/sess([a-z0-9]+)/(wordpress)") {
rewrite ^/sess([a-z0-9]+)/wordpress /wordpress/$2;
}

if ($uri ~ "^/sess([a-z0-9]+)/(phpmyadmin)") {
rewrite ^/sess([a-z0-9]+)/phpmyadmin /phpmyadmin/$2;
}

include fastcgi.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

}

Setting up wordpress with reverse proxy (no replies)

$
0
0
Hello everyone, I have a problem loading a website developed in wordpress.

Currently nginx is used to make a reverse proxy and to display the web under the domain demo.aspor.cl. The domain points to webdev.aspor.cl/wp (where the wordpress is installed) and it has limited access by IP (but demo.aspor.cl is public to everyone).

The problem is that currently the web is loading partially and I think it happens because nginx is not well configured, but I really do not know because I I am not an expert in the subject (I am developing a site for a client that does handle the issue better).

The other option that I'm considering is that because of wordpress absolute paths the website does not load the style sheets, js and others, so the web does not works correctly. I'm posting to ask for help or guidance to see how to solve this problem :)

I hope it's the right way to post it on the forum, I'm new to this.

Greetings and thanks,

Isaiah Gonzalez D.

Authentification of clients (no replies)

$
0
0
Hello,

I have a Nging to Forward Proxy.

I want auto authent clients requests with dedicated account manage by me.

So, clients don't know never this dedicated acccount.
=> Just, they send their requests without an authentication option.

In Nginx, when it receive requests to site1, Nginx auto authenticate request to site1 with dedicated account manage by me in local.

I don't know how to make it ? :(

Thanks for any helps !

Rominou27

No access to nginx server from www (no replies)

$
0
0
I installed a LEMP server on an odroid c2 (LEMP=Nginx, mariadb, phpmyadmin, php-fpm et wordpress).
Eveything is woking in my home local network but i cannot access server from outside my local network.
To have access to the server from the www, having a classical internet box routed, I've assigned a fixed ip to the server (192.168.0.xx) and redirected port 80 for this ip in tcp.
I also took a free domain name for the public IP of my freebox.(IP xxx.xxx.xxx.xxx -> my-site.ocry.com).

This domain name is well registered and active in the parameters of my internet box provider (Reverse DNS custom).
When I test from the www url site (www.domain name or public IP port 80) it fails and I have a page: "This site is inaccessible, 127.0.0.1 took too long to answer".
it's been 4 days that I can not find a solution; thanks for any help;

I went to https://ping.eu/,
a DNS lookup on the domain name refers to the public IP of my BOX.
a PING is successful
a port check tells me that port 80 and 8080 are open.

here is my server config in /etc/sites-available/my-site


server {
listen 80;
listen [::]:80;

server_name my-site.ocry.com;
root /var/www/my-site;

index index.php index.html;

location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_read_timeout 600;
}
}

How do I let linux assign the port that nginx listens on? (no replies)

$
0
0
This may seem like an odd request but I have a situation where I want to start nginx and let linux assign the port that nginx listens on. I would have thought that listen 0 default_server; would allow this but alas, no.

Is there a way to get nginx to allow linux to assign its port? (And please don't challenge why I want to do this...that's not up for debate :-)

-- Mike Kilian

log/list IP Address accessing folder (1 reply)

$
0
0
Hello, I am using nginx for Windows and is there a log on what IP Address accessed the webserver folder? if not, is there a program that I can use to monitor a folder and tell me the IP Addresses of the computers that accessed the folder?
Thanks
Viewing all 2931 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>