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

auth_basic with proxy_pass problem (1 reply)

$
0
0
Hello,

I have strange behavior when I try to use auth_basic with proxy_pass.

Basically need to do auth_basic by Nginx and if it is passed proxy_pass to RabbitMQ management console.

Browser is asking for credentials on every request, every file js, css, png etc.... when I pass valid data, single resource is downloaded.

Is there any way so it asks first time and then remembers it?

My config looks like:

upstream rabbitmq {
server 127.0.0.1:15672;
}

server {
server_name rabbitmq.example.com;
location / {
auth_basic "restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_read_timeout 600;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://rabbitmq/;
}
}

Thanks for help,

Maciej

Basic Auth problem: Allow only local IP (no replies)

$
0
0
Hi all! I've been using nginx for a while now and it's a fantastic product!

I've got a reverse proxy setup which provides HTTPS redirection (with an SSL cert self-signed by openssl) via my dyndns provided domain name. This is running on Lubuntu 15.10 (32-bit). I've got the latest nginx installed - running "apt-cache policy nginx" tells me the version is 1.9.3

I'm now in the process of setting up authentication and I've got that mostly working. However I'd like to be able to access the pages via dns name, from my local network without authentication, and only require authentication when I'm accessing it from outside my network.

Below are the three scenarios and outcomes I currently have. I currently need help with scenario 3:

1. From my home PC if I access the nginx server via local IP address (http://192.168.1.x), I get redirected correctly to https://192.168.1.x and don't get prompted for authentication - everything works correctly.

2. From an outside PC, if i access the nginx server via dyndns domain name (http://myname.dyndns.org), I get redirected correctly to https://myname.dyndns.org and DO get prompted for authentication - everything works correctly.

3. From my home PC, if I access the nginx server via dyndns domain name (http://myname.dyndns.org) I get redirected correctly to https://myname.dyndns.org and DO get prompted for authentication - In this case, I shouldn't be prompted for authentication, as I'm accessing the server from my internal network..

I've tried to implement a satisfy any; clause, however I'm not sure it's working correctly..

Can anyone help me out?

Here's my nginx config file:

server {
listen 80;
server_name 192.168.1.x;
return 301 https://$server_name$request_uri;
}

server {
listen 80;
server_name myname.dyndns.org;
return 301 https://$server_name$request_uri;
}

# The above two server blocks simply redirect to the https server block below

server {
server_name myname.dyndns.org 192.168.1.x; #set the servernames to listen for
listen 443 ssl; #Listen for 443/SSL only

ssl_certificate /path/to/my/SSL.crt; #specify an SSL cert
ssl_certificate_key /path/to/my/SSL.key; #SSL cert's key file

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:!DH+3DES:!ADH:!AECDH!MD5;
ssl_session_timeout 120m;
ssl_session_cache shared:SSL:2m;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; always"; #Addresses man-in-the-middle attacks for http to https redirection

error_log /var/log/nginx/myname.dyndns.org_auth.log; #error log which is used by fail2ban to ban IPs which wrongly login

auth_basic "Please login.";
auth_basic_user_file /path/to/my/userpasswords.file; #login credentials

satisfy any; #when logging in, either satisfy the ip range below or the credentials (not both)
allow 192.168.1.0/24; #allow only local IPs without authentication
deny all; #force all other IPs to login with authentication

#Root web pages
location / {
root /path/to/my/html/files;
}

location /service1 {
client_max_body_size 10m; # Allows the upload of up to 10MB .nzb files - default is 1MB
proxy_pass http://127.0.0.1:1111;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /service2 {
proxy_pass http://127.0.0.1:2222;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /service3 {
proxy_pass http://127.0.0.1:3333;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

Thanks so much for your input.
I primarily want to resolve my authentication issues, but if you've got any pointers on making the above code more efficient/cleaner etc, please let me know.

Need help getting guacamole added to external nginx that has ssl installed (no replies)

$
0
0
I'm very new to nginx. I've used apache2 but when I decided to try hosting my site on a raspberry pi 2, it was recommended to use nginx. I have my set setup with https and a commercial ssl. I installed guacamole on my FreeNAS in a jail (Still trying to get RDP to Windows 10 working...) and even forwarded the 8080 port in my firewall for external access. When I attempt to go to http://website.com:8080/guacamole it automatically changes to https and shows the following:

Secure Connection Failed

An error occurred during a connection to website.com:8080. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.

But, when I access it via http://IPaddress:8080/guacamole it works just fine.

Here is my enabled-site file:

###########################################################################################
server {
listen 80;
server_name website.com www.website.com;
location /guacamole/ {
proxy_pass http://website.com:8080/guacamole/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
access_log off;
}
###### phpMyAdmin ############################################################
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
root /usr/share/;
#include fastcgi-gen.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 240;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
}

server {
listen 443 ssl;
server_name website.com www.website.com;

ssl_certificate /etc/nginx/ssl/website.com_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/website.com.key;

root /data/website.com/www;
index index.php index.html index.htm;

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/website.com/www;
}

# Error & Access logs
error_log /data/website.com/logs/error.log error;
access_log /data/website.com/logs/access.log;

location / {
index index.html index.php;
}

###### phpMyAdmin ############################################################
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
root /usr/share/;
#include fastcgi-gen.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 240;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}

location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
#server unix:/var/run/php5-fpm.sock;
}
}
###########################################################################################

Any help would be appreciated!

Whitelist IP addresses with split_traffic (no replies)

$
0
0
Hi,

I have an issue with a/b testing setup. I'm splitting traffic based on $remote_addr and setting up a cookie to ensure the user is always going to the site it was chosen for him.

My problem is that I want clients coming from certain IP addresses to go to a certain version of the site, but it doesn't seem to work as expected. I have attached the configuration files for reference.

Is there a way I can achieve this?

Thanks.

Systemd can make uwsgi work but not nginx (502 Bad gateway) (no replies)

$
0
0
I can start uwsgi either from the shell or enabling / starting it via systemctl. In both cases the site or the test.py file works well only when I start nginx from the shell. But when I start nginx via systemctl I get 502 Bad gateway.

I looked at processes and even if I start nginx manually or via systemctl, it is run by user nginx, no difference.

The nginx.service file is the default one installed from EPEL and almost identical to the example on this website, but none of these service files make nginx work well. I don't think its the problem with socket permissions as I've made it work whith nginx started manually, and even if I switch to use IP port instead, systemctl wont make nginx work well.


[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Reverse Proxy Config Issue with Joomla SEF URL's (2 replies)

$
0
0
We have a reverse proxy setup such that NGINX serves cached Joomla (v. 3.5) content. One issue we have is that in the cache folder an index.php file is being created containing only the text string "sefs updated." This then breaks the display of any non-SEF URL like index.php?option-com_content.... The site uses friendly URL generated by SH404SEF. Our server section in that portion of the www.domainname.com.conf file looks like this. What should be change such that index.php isn't cached? Once we delete the index.php file which arises inside the cache folder the non-sef content displays just fine. But it comes back time and time again and has to be deleted from the cache store.


server_name_in_redirect off;
root /var/www/cache/nginx;
index index.php index.html;

error_page 566 = @post;

if ($request_method = POST) { return 566; }

set $original_uri $uri;

if ($uri = /) { set $original_uri "index.html"; }
#if ($uri = /) { return 566; }


location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
return 403;
error_page 403 /403_error.html;
root /var/www/html;
}

location ~* \.(ico|pdf|flv)$ {
expires 1y;
root /var/www/html;
error_page 404 = @stor;
}

location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt|svg|pdf)$ {
expires 14d;
root /var/www/html;
error_page 404 = @stor;
}

location / {
#try_files /var/www/cache/nginx/$original_uri @stor;
default_type text/html;
error_page 403 404 = @stor;
}


Plus some exclusions ....

Windows Auth Pass Through??? (no replies)

$
0
0
Hi All. New to NGINX and trying to get a basic load balancer up and running. I've successfully configured it to pass through to a site that doesn't use any type of auth, but when I try to direct toward our local intranet (sharepoint) it continuously asks for username and pass and doesn't take me any further.

Our sharepoint 2013 site is set up to use windows authentication without supplying a username and password. It is somehow digesting this info via the browser or some other authentication method from the client's local machine.

I've thought about adding in an ldap module, but I don't really need NGINX to authenticate, unless its required before passing it along.

Any help would be much appreciated. Thanks in advance.

Logs sent to stdout in docker but seeing old logs where are they coming from? (no replies)

$
0
0
I have NGINX setup in a docker container which configures NGINX access logs to stdout with this

RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log

When the container is built I see access logs scroll across my terminal from late last year until it reaches today. At which point anytime I hit my server I see the new output of the logs in my terminal.

I SSHed into the container and checked for any old log files in /var/* but cannot find any. It seems as if logs are being stored somewhere in the container.

Where can I check for the old logs to clear them out. I'd like to delete them because starting and stopping the container makes my terminal scroll for 5-10 minutes worth of logs.Is there any caching / buffering of logs which I can clear some how. I've searched the entire container for strings within the logs but cannot find them.

Any help is appreciated

Thanks

Cannot restart nginx properly, yet I can start and stop it and they're both okay (no replies)

$
0
0
It seems that whenever I use /etc/init.d/nginx restart I am always receiving an error. But using /etc/init.d/nginx start or /etc/init.d/nginx stop everything works well. I'm using Ubuntu 14.04 with mainline ppa. I used the ppa thing since adding the direct source of nginx mainline/stable in Ubuntu and installing it does not generate the "sites-enabled" and "sites-available" folders. Plus, hhvm says that the nginx installation is corrupted. Using the "warn" feature of the error log outputs blank. That is why I changed it to debug.

For reference, I also attached the conf files.

RP Nginx and Outlook Anywhere with NTLM Authentication (1 reply)

$
0
0
Hi everybody,

I am currently migrating a reverse proxy ISA server to a Nginx proxy.

Everything is ok except the part outlook anywhere ...

With ISA Server, there are currently 100 users outlook anywhere with NTLM authentication configured on the client. On my ISA Server, authentication is at "No delegation, but client may authenticate directly"

I want to put on my RP nginx, a "transparent" mode allowing me to make my Exchange server authentication lying behind my RP. I can not make this part.

Can you help me or advise me?

Below, my config file for Part RPC over https.

Thank you in advance,


server {

listen 443 ssl;
server_name mail.example.com;
server_name mail2.example;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_certificate /etc/ssl/certs/example.com.crt;
ssl_certificate_key /etc/ssl/certs/example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;

proxy_http_version 1.1;
proxy_read_timeout 3h;
proxy_pass_header Date;
proxy_pass_header Server;
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_set_header Accept-Encoding "";

client_body_buffer_size 1024k;
proxy_buffering off;

location / { return 301 https://mail.example.com/owa;}

location /owa { proxy_pass https://mail.local/owa;include /etc/nginx/naxsi/naxsi_mail.rules;include /etc/nginx/naxsi_whitelist/mail-whitelist.rules;more_set_headers -s 401 'WWW-Authenticate: Basic';more_set_input_headers 'Authorization: $http_authorization';proxy_set_header Connection "Keep-Alive"; proxy_pass_request_headers on; proxy_buffering off;proxy_pass_header Authorization;}
location /Microsoft-Server-ActiveSync { proxy_pass https://mail.local/Microsoft-Server-ActiveSync;include /etc/nginx/naxsi/naxsi_mail.rules;include /etc/nginx/naxsi_whitelist/mail-whitelist.rules; }
location /rpc/rpcproxy.dll { proxy_pass http://mail.local/rpc/rpcproxy.dll;include /etc/nginx/naxsi/naxsi_mail.rules;include /etc/nginx/naxsi_whitelist/mailm-whitelist.rules;proxy_set_header Connection "Keep-Alive";proxy_pass_request_headers on; proxy_buffering off;client_max_body_size 2G;proxy_request_buffering off;more_set_headers -s 401 'WWW-Authenticate: Basic';proxy_redirect default;more_set_input_headers 'Authorization: $http_authorization';}
access_log on;
access_log /var/log/nginx/mail-access.log;
error_log /var/log/nginx/mail-error.log warn;
}

XML problem with refresh page (no replies)

$
0
0
Hello, I use Lua code for XML file but I get problem ( error 500 ) when I try to get more then once some atribute.

here is a my code :

rewrite_by_lua '
require("LuaXml")
local xfile = xml.load("test.xml")
local xscene = xfile:find("scene")
ngx.say(xscene.id)
';

First time work fine, but next time when I going to refreshing location I get error :

lua entry thread aborted: runtime error: rewrite_by_lua(nginx.conf:41):3: attempt to index global 'xml' (a nil value)
stack traceback:
coroutine 0:
rewrite_by_lua(nginx.conf:41):3: in function <rewrite_by_lua(nginx.conf:41):1>, client: 127.0.0.1, server: localhost, request: "GET /testlua HTTP/1.1", host: "127.0.0.1:8080"

Please help me to resolve this problem !

Cannot allow access to acme-challenge, tried everything (no replies)

$
0
0
Hi everyone,

I am desperate and have tried for hours and days to make it work but still nothing.
I wanted to use Let's Encrypt with my wordpress ubuntu server, and for that I need to allow .well-known to do the acme-challenge. I have tried everything, every combination possible, every guide on the internet, and still cannot allow access to .well-known. I don't know what to do anymore.
I added rules to locations.conf, to each server-available file, every possible rule combination, redirected to another folder for /.well-known/acme-challenge following some guides to centralize licenses, still nothing. What am I missing?
BTW, I used EasyEngine for the installation, but that should not change anything. I actually used a guide on EE in the beginning which also didn't work, and then tried everything else. What else should I check, what other thing could be preventing me?
Another thing, I have a VM running ubuntu on my pc for the server, and I am using No-IP for a dyndns. Still that should not change anything, because when I try to open .well-known, I get a Forbidden message from Nginx, so it does reach the server, but Nginx doesn't allow. Help!

Nginx location group capture + rewrite? (1 reply)

$
0
0
I'm trying to do a group capture in a Nginx location block and it's not working for me.

Is what I am trying to do even possible?

location ~* /(?<cat>cars|trucks|bikes|motorcycle|quads) {
rewrite ^/$cat/([0-9]+)(.*)$ /page.php?id=$1 last;
}

The error message I am receiving is :

"^/$cat/([0-9]+)(.*)$" does not match "/cars/120/new-car-rentals/"

I have a lot more categories than what I am posting, and trying to prevent writing a rewrite 5x for each specific category name.

This is where I got the syntax from : http://nginx.org/en/docs/http/server_names.html#regex_names

Any help would be appreciated.

Pydio and Baikal parallel on a Raspberry (no replies)

$
0
0
Hello,

my project is already described in the headline.

pydio is running and I can access it very well via browser.
Problems:
I was not able to get WebDAV running which leads to some lines in my config file without effect?!
I tried to add some rewrite things because if I click reload if pydio user is logged in I receive " No input file specified."
WHy did I want to add this? PydioSync Clients on Windows are not working without some adjustments like rewrite.

baikal was quite fast installed and I can login via browser.
Issues:
I am not able to connect via a client caldav. The log in my client showes the same error message as above.

I would like to ask you if you could have a look on my myserver.my-wan.de.conf file.
I hope you can tell me the needed commands for my issues and maybe you have good improvments for me.

Many thanks in advance!!!

Redirect all url to single php (1 reply)

$
0
0
Hi, i want a single php script to handle all incoming requests to my /blog directoy. The php script checks wether a SQL record exists for the url (i.e. www.example.com/blog/example_article). If a record is found it serves the corresponding page data. If there is no record for a url (i.e. www.example.com/blog/nothing_here) it redirects to 404.

I need a rewrite rule in nginx for that.

My current config:

root /usr/share/nginx/html/example/;
index index.php;

server_name example.com www.example.com;

location / {
try_files $uri $uri/ @extensionless-php;
}

location /blog {
rewrite ?; // here i need a rewrite rule
}

location /uploads {
deny all;
}

error_page 404 /templates/404.php;

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_intercept_errors on;
}

location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}

Please note that i am using extensionless URL's.

nginx 500 error when file 99% uploaded (no replies)

$
0
0
Dear all, I am using nginx/1.8.0 and to debug a large file upload issue I am facing in WordPress, I post a file with a simple script:

Index file:

<html>
<!-- index.html -->
<head></head>
<body>
<form action="do.php" method="post" enctype="multipart/form-data" name="form">
<label>File:</label><br/><br/>
<input type="file" name="uploaded" required><br/><br/>
<input type="submit" value="Upload">
</form>
</body>
</html>

And php code below:

<?php
// this code lives in do.php
$file = $_FILES['uploaded']['tmp_name'];
$image = addslashes(file_get_contents($_FILES['uploaded']['tmp_name']));
$image_name = addslashes($_FILES['uploaded']['name']);
move_uploaded_file($_FILES["uploaded"]["tmp_name"], "uploads/" . $_FILES["uploaded"]["name"]);\
echo( $_FILES["uploaded"]["name"] );
?>

I am not seeing anything in the error logs, just returned in Chrome headers for `http://example.com/do.php` `Code:500 Internal Server Error`

This seems to happen when nginx has 99% finished uploading a file (anything under 100MB seems OK) I can track the upload progress in the temp directory:

root@www:/home/example/logs# ll -h /var/lib/nginx/
total 28K
drwxr-xr-x 7 root root 4.0K Feb 4 14:32 ./
drwxr-xr-x 42 root root 4.0K Feb 5 06:26 ../
drwx------ 2 www-data root 4.0K Apr 18 20:46 body/
drwx------ 12 www-data root 4.0K Feb 4 17:19 fastcgi/
drwx------ 2 www-data root 4.0K Feb 4 14:32 proxy/
drwx------ 2 www-data root 4.0K Feb 4 14:32 scgi/
drwx------ 2 www-data root 4.0K Feb 4 14:32 uwsgi/

root@www:/home/example/logs# ll -h /var/lib/nginx/body/
total 103M
drwx------ 2 www-data root 4.0K Apr 18 20:46 ./
drwxr-xr-x 7 root root 4.0K Feb 4 14:32 ../
-rw------- 1 www-data www-data 103M Apr 18 20:47 0000000239

I have even set the `/var/lib/nginx` to `chown www-data:www-data` but still get the same error.

I have put in `http`, `server`, `location` sections the following, but again does not make a difference:

client_body_in_file_only clean;
client_body_buffer_size 32k;
client_max_body_size 300M;
send_timeout 900s;
proxy_connect_timeout 900s;
proxy_send_timeout 900s;
proxy_read_timeout 900s;
fastcgi_send_timeout 900s;
fastcgi_read_timeout 900s;
fastcgi_buffer_size 64k;
fastcgi_buffers 32 32k;

I am using php5-fpm, and all matching similair upload and max-memory settings to match nginx equivalents but this seems to be coming from nginx as i cant see any errors anywhere (any reason this is not logged)?

Any ideas please, I am ripping my hair out!?

nginx service wouldn't start (3 replies)

$
0
0
Hello,
I'm trying to run nginx server on CentOS7 and getting the following errors:

`Job for nginx.service failed because the control process exited with error code.`

When checking for a status I got the following:

` Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2016-04-19 15:25:56 CEST; 57s ago
Process: 19132 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Process: 19130 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Main PID: 18515 (code=exited, status=0/SUCCESS)`

Is it any suggestions where should I start to debug? Thanks.

problems with upstream (no replies)

$
0
0
I try to use upstream and proxy for load balancing on CentOS 7 Minimal, but something is wrong. I use this manual: http://nginx.org/en/docs/http/load_balancing.html. When I open Nginx localhost in browser, it tells me, that «Site is temporarily unavailable» and writes this strings in error log:

2016/04/13 18:36:59 [crit] 5427#0: *20 connect() to 192.168.1.240:8080 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.15, server: _, request: "GET / HTTP/1.1", upstream: "http://192.168.1.240:8080/", host: "192.168.1.135"
2016/04/13 18:36:59 [crit] 5427#0: *20 connect() to 192.168.1.237:8080 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.15, server: _, request: "GET / HTTP/1.1", upstream: "http://192.168.1.237:8080/", host: "192.168.1.135"

Someone adviced me to turn off SElinux and see what I'll get. But when turned it off, I go to [upstream name] link, not the [upstream server].

I mean, when i use:

upstream sites { server 192.168.1.237:8080; }

location / { proxy_pass http://sites; }


I point my browser to http://localhost, and nginx redirects me to http://sites:8080, instead of http://192.168.1.1:8080.

I can't understand what's wrong, the manual said everything should work.
Help, please.

reverso proxy to different root (no replies)

$
0
0
Hi
im running nginx/1.6.2 on raspberry pi
i user nginx for owncloud
the root in owncloud file is /var/www

currently i try now to configure trasmission torrent web as a roverse proxy

server {
listen 80;
server_name (my dns name), (my local ipaddress)10.0.0.2;
location /transmission {
proxy_pass http://127.0.0.1:9091;
index index.html
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

but the problem is that nginx takes the root of owncloud and this is why the site of transmission is not found

2016/04/21 09:49:23 [error] 15966#0: *5 open() "/var/www/transmission" failed (2: No such file or directory),

how i should change/add a new root instead that pointing to :/"var/www"?
Thanks

NGiNX as file upload server (no replies)

$
0
0
Hello

I want use NGiNX server for uploading files and I don't want use any of third-party modules or PHP/Backend servers.

Simple upload.

Possible use: curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload

How can I configure latest NGiNX for that purpose?
Viewing all 2931 articles
Browse latest View live


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