Quantcast
Channel: Nginx Forum
Viewing all 53287 articles
Browse latest View live

Re: Is there a wait to get at a module's main conf inside the loc conf's init?

$
0
0
Maxim Dounin Wrote:
-------------------------------------------------------

>
> Try ngx_http_conf_get_module_main_conf().
>
> (Doing so in the create_loc_conf callback is probably pointless
> though, as main conf contents can be changed later.)
>
> --
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


On a related note, is there a way to get the my module's main/srv/loc conf_t instances from the cycle instance passed to the worker process init callback in my module? I see my conf objects created and put into the ctx object before the worker process init is called, so I think there there.

From reading the code, I tried something like:

#define ngx_http_cycle_get_module_main_conf(cf, module) \
((ngx_http_conf_ctx_t *) (cycle)->conf_ctx)->main_conf[(module).ctx_index]


/* declared as init process in ngx_module_t */
static ngx_int_t ngx_my_init_worker_process(ngx_cycle_t *cycle) {
ngx_http_my_module_conf_t *main_conf;
main_conf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_my_module);
}

but that either just returned Nulls or crashed. I suspect there's a simpler way.

Thank you very much!

Re: Is there a wait to get at a module's main conf inside the loc conf's init?

$
0
0
Hello!

On Thu, Aug 17, 2017 at 02:34:20AM -0400, ptcell wrote:

> Maxim Dounin Wrote:
> -------------------------------------------------------
>
> >
> > Try ngx_http_conf_get_module_main_conf().
> >
> > (Doing so in the create_loc_conf callback is probably pointless
> > though, as main conf contents can be changed later.)
>
> On a related note, is there a way to get the my module's main/srv/loc conf_t
> instances from the cycle instance passed to the worker process init callback
> in my module? I see my conf objects created and put into the ctx object
> before the worker process init is called, so I think there there.

This is something generally better to avoid (because getting a
module configuration from a cycle implies that there can be only
one http{} block), but it is certainly possible to obtain main
configuration via ngx_http_cycle_get_module_main_conf(). For an
example, see ngx_http_perl_init_worker() in the perl module:

http://hg.nginx.org/nginx/file/tip/src/http/modules/perl/ngx_http_perl_module.c#l1041

> From reading the code, I tried something like:
>
> #define ngx_http_cycle_get_module_main_conf(cf, module)
> \
> ((ngx_http_conf_ctx_t *)
> (cycle)->conf_ctx)->main_conf[(module).ctx_index]

It is not clear where you get this macro. Defined it yourself?
You certainly did it wrong. Correct macro is defined in
src/http/ngx_http_config.h as follows:

#define ngx_http_cycle_get_module_main_conf(cycle, module) \
(cycle->conf_ctx[ngx_http_module.index] ? \
((ngx_http_conf_ctx_t *) cycle->conf_ctx[ngx_http_module.index]) \
->main_conf[module.ctx_index]: \
NULL)

You don't need to redefine it, just use it as is.

--
Maxim Dounin
http://nginx.org/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

How to password protect Wordpress Multisite Site and subdirectory, file.

$
0
0
I'm having Wordpress Multisite Setup with Wordpress MU Domain Mapping plugin and Nginx Helper using config in the link below.


https://paste.ngx.cc/7d

Can't make password protection over specific domains, subdirectories or files seem to work. After authentication WSOD or File download.

Re: Reverse proxy for multiple domains

$
0
0
On Thu, Aug 10, 2017 at 09:17:14PM +0000, Mik J via nginx wrote:

Hi there,

> I have application1.org and application2.org.
>
> The client requesting these URLs, arrives one the reverse proxy.
>
> On this reverse proxy I have a virtual host which looks like that
>
> server {
> server_name application1.org;
> location ^~ / {
> proxy_pass http://10.1.1.10:80/app/application1/;
> }
>
> And another virtual host for application2 which is similar with
>
> proxy_pass http://10.1.1.10:80/app/application2/;
>
>
> The server behind the reverse proxy is the same right now

> 1) Is it the right way to do this ?

I think that trying to reverse-proxy an application at a different part
of the url tree to where the app thinks it is installed, is difficult.

So if application1 believes that it is installed at /app/application1,
I would suggest to expose that to the world. (Or: if you want the world
to see it at /, then configure the internal server so that it is at /
there too.)

Then your external config is mostly just "proxy_pass
http://10.1.1.10:80;", possibly with "location = / { return 301
/application/app1/; }"

The *internal* config could probably have one server{} for each
application as well.

> 2) When I access the application from Internet using application1.org, I am redirected to application1.org/app/application1 I don't know why. And I have to add one more section on the reverse proxy

> Is there a better way to do it ?

I'm not sure why that extra section is necessary, unless the "..." part
of your config is important.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: is proxy_read_timeout effects for a slow response?

$
0
0
On Tue, Aug 15, 2017 at 05:47:23AM -0400, foxgab wrote:

Hi there,

> if nginx connect to a proxied server successfully, but the server takes a
> long time before starting to send the response, will proxy_read_timeout
> directive effect? if not, is there any other directive do that timeout kind
> work?

The documentation at http://nginx.org/r/proxy_read_timeout suggests "yes".

A quick test indicates that it does:

In one shell, a listener that will be slow to respond:

nc -l 127.0.0.1:10880

nginx.conf:

server {
location / {
proxy_read_timeout 6;
proxy_pass http://127.0.0.1:10880;
}
}

Test command:

date; curl -v http://127.0.0.1/test; date

I get a http response after 6 seconds.

> when proxy_next_upstream is set to "off", which status code will be respond
> if timeout?

"Gateway Timeout" is 504.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Ошибки при установке NGINX

$
0
0
Доброго времени суток.

Ubuntu-16.04-x86_64 (сервер)

Устанавливаю NGINX:

> apt-get install nginx

Получаю ошибки:

------------------------

Setting up nginx-core (1.10.3-0ubuntu0.16.04.2) ...
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
dpkg: error processing package nginx-core (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-core (>= 1.10.3-0ubuntu0.16.04.2) | nginx-full (>= 1.10.3-0ubuntu0.16.04.2) | nginx-light (>= 1.10.3-0ubuntu0.16.04.2) | nginx-extras (>= 1.10.3-0ubuntu0.16.04.2); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-core (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-full (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.2.1~); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.

dpkg: error processing package nginx (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

----------------------------

Как установить nginx?

Спасибо

Re: Ошибки при установке NGINX

$
0
0
Вначале внимательно изучить вывод journalctl -xe
У вас же написано какую команду выполнить чтобы узнать детали

17 авг. 2017 г. 23:01 пользователь "Andrey_Bushman" <
nginx-forum@forum.nginx.org> написал:

> Доброго времени суток.
>
> Ubuntu-16.04-x86_64 (сервер)
>
> Устанавливаю NGINX:
>
> > apt-get install nginx
>
> Получаю ошибки:
>
> ------------------------
>
> Setting up nginx-core (1.10.3-0ubuntu0.16.04.2) ...
> Job for nginx.service failed because the control process exited with error
> code. See "systemctl status nginx.service" and "journalctl -xe" for
> details.
> invoke-rc.d: initscript nginx, action "start" failed.
> dpkg: error processing package nginx-core (--configure):
> subprocess installed post-installation script returned error exit status 1
> dpkg: dependency problems prevent configuration of nginx:
> nginx depends on nginx-core (>= 1.10.3-0ubuntu0.16.04.2) | nginx-full (>=
> 1.10.3-0ubuntu0.16.04.2) | nginx-light (>= 1.10.3-0ubuntu0.16.04.2) |
> nginx-extras (>= 1.10.3-0ubuntu0.16.04.2); however:
> Package nginx-core is not configured yet.
> Package nginx-full is not installed.
> Package nginx-light is not installed.
> Package nginx-extras is not installed.
> nginx depends on nginx-core (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-full
> (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-light (<<
> 1.10.3-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.2.1~);
> however:
> Package nginx-core is not configured yet.
> Package nginx-full is not installed.
> Package nginx-light is not installed.
> Package nginx-extras is not installed.
>
> dpkg: error processing package nginx (--configure):
> dependency problems - leaving unconfigured
> Errors were encountered while processing:
> nginx-core
> nginx
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> ----------------------------
>
> Как установить nginx?
>
> Спасибо
>
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?21,276085,276085#msg-276085
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Ошибки при установке NGINX

$
0
0
Вывод обозначенных команд мне не сильно помог:

root@bimpack:~# systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-08-17 15:53:41 EDT; 16min ago
Process: 15842 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Process: 15839 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

Aug 17 15:53:39 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 17 15:53:39 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 17 15:53:40 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 17 15:53:40 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 17 15:53:41 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Aug 17 15:53:41 vds nginx[15842]: nginx: [emerg] still could not bind()
Aug 17 15:53:41 vds systemd[1]: nginx.service: Control process exited, code=exited status=1
Aug 17 15:53:41 vds systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Aug 17 15:53:41 vds systemd[1]: nginx.service: Unit entered failed state.
Aug 17 15:53:41 vds systemd[1]: nginx.service: Failed with result 'exit-code'.
root@bimpack:~#

root@bimpack:~# journalctl -xe
Aug 17 16:09:30 vds sshd[16000]: error: maximum authentication attempts exceeded for root from 42.7.26.91 port 48424 ssh2 [preauth]
Aug 17 16:09:30 vds sshd[16000]: Disconnecting: Too many authentication failures [preauth]
Aug 17 16:09:30 vds sshd[16000]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:09:30 vds sshd[16000]: PAM service(sshd) ignoring max retries; 6 > 3
Aug 17 16:09:32 vds sshd[16002]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:09:34 vds sshd[16002]: Failed password for root from 42.7.26.91 port 9055 ssh2
Aug 17 16:09:37 vds sshd[16002]: Failed password for root from 42.7.26.91 port 9055 ssh2
Aug 17 16:09:39 vds sshd[16002]: Failed password for root from 42.7.26.91 port 9055 ssh2
Aug 17 16:09:42 vds sshd[16002]: Failed password for root from 42.7.26.91 port 9055 ssh2
Aug 17 16:09:45 vds sshd[16002]: Failed password for root from 42.7.26.91 port 9055 ssh2
Aug 17 16:09:48 vds sshd[16002]: Failed password for root from 42.7.26.91 port 9055 ssh2
Aug 17 16:09:48 vds sshd[16002]: error: maximum authentication attempts exceeded for root from 42.7.26.91 port 9055 ssh2 [preauth]
Aug 17 16:09:48 vds sshd[16002]: Disconnecting: Too many authentication failures [preauth]
Aug 17 16:09:48 vds sshd[16002]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:09:48 vds sshd[16002]: PAM service(sshd) ignoring max retries; 6 > 3
Aug 17 16:09:50 vds sshd[16005]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:09:52 vds sshd[16005]: Failed password for root from 42.7.26.91 port 32425 ssh2
Aug 17 16:09:55 vds sshd[16005]: Failed password for root from 42.7.26.91 port 32425 ssh2
Aug 17 16:09:58 vds sshd[16005]: Failed password for root from 42.7.26.91 port 32425 ssh2
Aug 17 16:10:01 vds sshd[16005]: Failed password for root from 42.7.26.91 port 32425 ssh2
Aug 17 16:10:03 vds sshd[16005]: Failed password for root from 42.7.26.91 port 32425 ssh2
Aug 17 16:10:07 vds sshd[16005]: Failed password for root from 42.7.26.91 port 32425 ssh2
Aug 17 16:10:07 vds sshd[16005]: error: maximum authentication attempts exceeded for root from 42.7.26.91 port 32425 ssh2 [preauth]
Aug 17 16:10:07 vds sshd[16005]: Disconnecting: Too many authentication failures [preauth]
Aug 17 16:10:07 vds sshd[16005]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:10:07 vds sshd[16005]: PAM service(sshd) ignoring max retries; 6 > 3
Aug 17 16:10:09 vds sshd[16009]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:10:11 vds sshd[16009]: Failed password for root from 42.7.26.91 port 57502 ssh2
Aug 17 16:10:13 vds sshd[16009]: Failed password for root from 42.7.26.91 port 57502 ssh2
Aug 17 16:10:15 vds sshd[16009]: Failed password for root from 42.7.26.91 port 57502 ssh2
Aug 17 16:10:19 vds sshd[16009]: Failed password for root from 42.7.26.91 port 57502 ssh2
Aug 17 16:10:21 vds sshd[16009]: Failed password for root from 42.7.26.91 port 57502 ssh2
Aug 17 16:10:24 vds sshd[16009]: Failed password for root from 42.7.26.91 port 57502 ssh2
Aug 17 16:10:24 vds sshd[16009]: error: maximum authentication attempts exceeded for root from 42.7.26.91 port 57502 ssh2 [preauth]
Aug 17 16:10:24 vds sshd[16009]: Disconnecting: Too many authentication failures [preauth]
Aug 17 16:10:24 vds sshd[16009]: PAM 5 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:10:24 vds sshd[16009]: PAM service(sshd) ignoring max retries; 6 > 3
Aug 17 16:10:26 vds sshd[16011]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
Aug 17 16:10:28 vds sshd[16011]: Failed password for root from 42.7.26.91 port 15843 ssh2
Aug 17 16:10:31 vds sshd[16011]: Failed password for root from 42.7.26.91 port 15843 ssh2
Aug 17 16:10:34 vds sshd[16011]: Failed password for root from 42.7.26.91 port 15843 ssh2

Re: Ошибки при установке NGINX

$
0
0
Как раз в логе все написано" Address already in use"

17 авг. 2017 г. 23:14 пользователь "Andrey_Bushman" <
nginx-forum@forum.nginx.org> написал:

> Вывод обозначенных команд мне не сильно помог:
>
> root@bimpack:~# systemctl status nginx.service
> ● nginx.service - A high performance web server and a reverse proxy server
> Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor
> preset: enabled)
> Active: failed (Result: exit-code) since Thu 2017-08-17 15:53:41 EDT;
> 16min ago
> Process: 15842 ExecStart=/usr/sbin/nginx -g daemon on; master_process on;
> (code=exited, status=1/FAILURE)
> Process: 15839 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on;
> master_process on; (code=exited, status=0/SUCCESS)
>
> Aug 17 15:53:39 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80
> failed
> (98: Address already in use)
> Aug 17 15:53:39 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80
> failed
> (98: Address already in use)
> Aug 17 15:53:40 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80
> failed
> (98: Address already in use)
> Aug 17 15:53:40 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80
> failed
> (98: Address already in use)
> Aug 17 15:53:41 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80
> failed
> (98: Address already in use)
> Aug 17 15:53:41 vds nginx[15842]: nginx: [emerg] still could not bind()
> Aug 17 15:53:41 vds systemd[1]: nginx.service: Control process exited,
> code=exited status=1
> Aug 17 15:53:41 vds systemd[1]: Failed to start A high performance web
> server and a reverse proxy server.
> Aug 17 15:53:41 vds systemd[1]: nginx.service: Unit entered failed state.
> Aug 17 15:53:41 vds systemd[1]: nginx.service: Failed with result
> 'exit-code'.
> root@bimpack:~#
>
> root@bimpack:~# journalctl -xe
> Aug 17 16:09:30 vds sshd[16000]: error: maximum authentication attempts
> exceeded for root from 42.7.26.91 port 48424 ssh2 [preauth]
> Aug 17 16:09:30 vds sshd[16000]: Disconnecting: Too many authentication
> failures [preauth]
> Aug 17 16:09:30 vds sshd[16000]: PAM 5 more authentication failures;
> logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:09:30 vds sshd[16000]: PAM service(sshd) ignoring max retries; 6
> >
> 3
> Aug 17 16:09:32 vds sshd[16002]: pam_unix(sshd:auth): authentication
> failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:09:34 vds sshd[16002]: Failed password for root from 42.7.26.91
> port 9055 ssh2
> Aug 17 16:09:37 vds sshd[16002]: Failed password for root from 42.7.26.91
> port 9055 ssh2
> Aug 17 16:09:39 vds sshd[16002]: Failed password for root from 42.7.26.91
> port 9055 ssh2
> Aug 17 16:09:42 vds sshd[16002]: Failed password for root from 42.7.26.91
> port 9055 ssh2
> Aug 17 16:09:45 vds sshd[16002]: Failed password for root from 42.7.26.91
> port 9055 ssh2
> Aug 17 16:09:48 vds sshd[16002]: Failed password for root from 42.7.26.91
> port 9055 ssh2
> Aug 17 16:09:48 vds sshd[16002]: error: maximum authentication attempts
> exceeded for root from 42.7.26.91 port 9055 ssh2 [preauth]
> Aug 17 16:09:48 vds sshd[16002]: Disconnecting: Too many authentication
> failures [preauth]
> Aug 17 16:09:48 vds sshd[16002]: PAM 5 more authentication failures;
> logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:09:48 vds sshd[16002]: PAM service(sshd) ignoring max retries; 6
> >
> 3
> Aug 17 16:09:50 vds sshd[16005]: pam_unix(sshd:auth): authentication
> failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:09:52 vds sshd[16005]: Failed password for root from 42.7.26.91
> port 32425 ssh2
> Aug 17 16:09:55 vds sshd[16005]: Failed password for root from 42.7.26.91
> port 32425 ssh2
> Aug 17 16:09:58 vds sshd[16005]: Failed password for root from 42.7.26.91
> port 32425 ssh2
> Aug 17 16:10:01 vds sshd[16005]: Failed password for root from 42.7.26.91
> port 32425 ssh2
> Aug 17 16:10:03 vds sshd[16005]: Failed password for root from 42.7.26.91
> port 32425 ssh2
> Aug 17 16:10:07 vds sshd[16005]: Failed password for root from 42.7.26.91
> port 32425 ssh2
> Aug 17 16:10:07 vds sshd[16005]: error: maximum authentication attempts
> exceeded for root from 42.7.26.91 port 32425 ssh2 [preauth]
> Aug 17 16:10:07 vds sshd[16005]: Disconnecting: Too many authentication
> failures [preauth]
> Aug 17 16:10:07 vds sshd[16005]: PAM 5 more authentication failures;
> logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:10:07 vds sshd[16005]: PAM service(sshd) ignoring max retries; 6
> >
> 3
> Aug 17 16:10:09 vds sshd[16009]: pam_unix(sshd:auth): authentication
> failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:10:11 vds sshd[16009]: Failed password for root from 42.7.26.91
> port 57502 ssh2
> Aug 17 16:10:13 vds sshd[16009]: Failed password for root from 42.7.26.91
> port 57502 ssh2
> Aug 17 16:10:15 vds sshd[16009]: Failed password for root from 42.7.26.91
> port 57502 ssh2
> Aug 17 16:10:19 vds sshd[16009]: Failed password for root from 42.7.26.91
> port 57502 ssh2
> Aug 17 16:10:21 vds sshd[16009]: Failed password for root from 42.7.26.91
> port 57502 ssh2
> Aug 17 16:10:24 vds sshd[16009]: Failed password for root from 42.7.26.91
> port 57502 ssh2
> Aug 17 16:10:24 vds sshd[16009]: error: maximum authentication attempts
> exceeded for root from 42.7.26.91 port 57502 ssh2 [preauth]
> Aug 17 16:10:24 vds sshd[16009]: Disconnecting: Too many authentication
> failures [preauth]
> Aug 17 16:10:24 vds sshd[16009]: PAM 5 more authentication failures;
> logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:10:24 vds sshd[16009]: PAM service(sshd) ignoring max retries; 6
> >
> 3
> Aug 17 16:10:26 vds sshd[16011]: pam_unix(sshd:auth): authentication
> failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=42.7.26.91 user=root
> Aug 17 16:10:28 vds sshd[16011]: Failed password for root from 42.7.26.91
> port 15843 ssh2
> Aug 17 16:10:31 vds sshd[16011]: Failed password for root from 42.7.26.91
> port 15843 ssh2
> Aug 17 16:10:34 vds sshd[16011]: Failed password for root from 42.7.26.91
> port 15843 ssh2
>
> Posted at Nginx Forum: https://forum.nginx.org/read.
> php?21,276085,276087#msg-276087
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Reverse proxy for multiple domains

$
0
0
Thank you Francis for your answer
Actually is does this with a simple index.html page# cat index.htmlTEST
What would you do if you had ?
CLIENT <-> INTERNET <->Reverse_Proxy<->Web_ServerOn de web server I just use one default virtual host with multiple sections. Thats because the pages are called by the reverse proxy server like http://10.1.1.10:80/app/application1/; and it can't use a FQDN because it's in a private adressing
Is there a way that the reverse proxy connects to 10.1.1.10 but pretend the GET/POST queries use application1.org ?

I'd prefer my application would be accessible by www.application1.org than www.application1.org/app/application1 like right now



Le Jeudi 17 août 2017 21h35, Francis Daly <francis@daoine.org> a écrit :


On Thu, Aug 10, 2017 at 09:17:14PM +0000, Mik J via nginx wrote:

Hi there,

> I have application1.org and application2.org.
>
> The client requesting these URLs, arrives one the reverse proxy.
>
> On this reverse proxy I have a virtual host which looks like that
>
> server {
> server_name application1.org;
> location ^~ / {
> proxy_pass        http://10.1.1.10:80/app/application1/;
> }
>
> And another virtual host for application2 which is similar with
>
> proxy_pass http://10.1.1.10:80/app/application2/;
>
>
> The server behind the reverse proxy is the same right now

> 1) Is it the right way to do this ?

I think that trying to reverse-proxy an application at a different part
of the url tree to where the app thinks it is installed, is difficult.

So if application1 believes that it is installed at /app/application1,
I would suggest to expose that to the world. (Or: if you want the world
to see it at /, then configure the internal server so that it is at /
there too.)

Then your external config is mostly just "proxy_pass
http://10.1.1.10:80;", possibly with "location = / { return 301
/application/app1/; }"

The *internal* config could probably have one server{} for each
application as well.

> 2) When I access the application from Internet using application1.org, I am redirected to application1.org/app/application1 I don't know why. And I have to add one more section on the reverse proxy

> Is there a better way to do it ?

I'm not sure why that extra section is necessary, unless the "..." part
of your config is important.

    f
--
Francis Daly        francis@daoine.org


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Re: Ошибки при установке NGINX

$
0
0
Здравствуйте!

Судя по логу, Вы уже пытались поставить nginx из репозиториев дистрибутива, а
теперь пытаетесь поставить nginx из репозиториев разработчиков nginx. Чтоб все
прошло хорошо, удалите хвосты от старого:

service nginx stop
killall nginx
apt-get purge nginx-core nginx

И после этого ставьте желаемую версию.

С уважением, Иван.

В письме от 17 августа 2017 16:01:10 пользователь Andrey_Bushman написал:
> Доброго времени суток.
>
> Ubuntu-16.04-x86_64 (сервер)
>
> Устанавливаю NGINX:
> > apt-get install nginx
>
> Получаю ошибки:
>
> ------------------------
>
> Setting up nginx-core (1.10.3-0ubuntu0.16.04.2) ...
> Job for nginx.service failed because the control process exited with error
> code. See "systemctl status nginx.service" and "journalctl -xe" for
> details.
> invoke-rc.d: initscript nginx, action "start" failed.
> dpkg: error processing package nginx-core (--configure):
> subprocess installed post-installation script returned error exit status 1
> dpkg: dependency problems prevent configuration of nginx:
> nginx depends on nginx-core (>= 1.10.3-0ubuntu0.16.04.2) | nginx-full (>=
> 1.10.3-0ubuntu0.16.04.2) | nginx-light (>= 1.10.3-0ubuntu0.16.04.2) |
> nginx-extras (>= 1.10.3-0ubuntu0.16.04.2); however:
> Package nginx-core is not configured yet.
> Package nginx-full is not installed.
> Package nginx-light is not installed.
> Package nginx-extras is not installed.
> nginx depends on nginx-core (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-full
> (<< 1.10.3-0ubuntu0.16.04.2.1~) | nginx-light (<<
> 1.10.3-0ubuntu0.16.04.2.1~) | nginx-extras (<< 1.10.3-0ubuntu0.16.04.2.1~);
> however:
> Package nginx-core is not configured yet.
> Package nginx-full is not installed.
> Package nginx-light is not installed.
> Package nginx-extras is not installed.
>
> dpkg: error processing package nginx (--configure):
> dependency problems - leaving unconfigured
> Errors were encountered while processing:
> nginx-core
> nginx
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> ----------------------------
>
> Как установить nginx?
>
> Спасибо
>
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?21,276085,276085#msg-276085
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Ошибки при установке NGINX

$
0
0
Я не однократно пытался установить из одного и того же места: командой, обозначенной мною в первом сообщении. Из исходников ничего не собирал. Вечером из дома попробую удалить и снова поставить, но надежда, что вдруг волшебным образом в этот раз установка пройдёт успешно - очень слабая.

Re: Ошибки при установке NGINX

$
0
0
Andrey_Bushman wrote:
> Вывод обозначенных команд мне не сильно помог:
> Aug 17 15:53:39 vds nginx[15842]: nginx: [emerg] bind() to 0.0.0.0:80
> failed (98: Address already in use)
У вас уже работает вебсервер. Выяснить, откуда он взялся, можно как-то так:

$ sudo netstat -anp | grep ':80 .*LISTEN'
tcp 0 0 0.0.0.0:80 0.0.0.0:*
LISTEN 1683/nginx.conf

$ ps ax | grep 1683 | grep -v grep
1683 ? Ss 0:00 nginx: master process /usr/sbin/nginx -c
/etc/nginx/nginx.conf

$ dpkg -S /usr/sbin/nginx
nginx: /usr/sbin/nginx
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Re: Ошибки при установке NGINX

$
0
0
Спасибо, вечером попробую проверить. Я по книжкам изучаю Linux и Nginx. Вот со вторым столкнулся с попыткой установки, т.к. предполагал, что он не установлен, в виду того, что команды `which nginx` и` whereis nginx` не возвращали полного имени файла.

Если он всё же установлен, то имеет ли смысл попробовать его деинсталлировать и установить заново? Я боюсь, что моя неоднократная попытка установить nginx могла его покоцать.

Re: Ошибки при установке NGINX

$
0
0
Здравствуйте, Andrey_Bushman.

Вы писали 18 августа 2017 г., 17:00:26:

> Спасибо, вечером попробую проверить. Я по книжкам изучаю Linux и Nginx. Вот
> со вторым столкнулся с попыткой установки, т.к. предполагал, что он не
> установлен, в виду того, что команды `which nginx` и` whereis nginx` не
> возвращали полного имени файла.

У Вас также может быть установлен другой сервис, использующий (слушающий) порт
80, например Apache.


--
С уважением,
Pavel mailto:pavel2000@ngs.ru

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Wordpress in subdirectory

$
0
0
wordpress and nginx both have instructions on how to configure nginx to work with wordpress.

https://codex.wordpress.org/Nginx
and
https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/

both assume a server dedicated to the wordpress site.

My situation is one that has the main symfony site at https://www.mydomain.com and I want the wordpress blog to be at https://www.mydomain.com/blog/

The server is configured for mydomain.com. I have a location for a forum package at /boards/ that works fine. However, I had extreme difficulties even getting /blog/ to load a standard index file.

One piece of the wordpress codex or nginx recipe that I haven't been able to figure out how to use is the upstream php block to abstract backend connections. Is that critical?
Is there a way for me to still use the upstream php with just one location?

I've attached my nginx config. Please let me know if I can provide more information, and thank you in advance for any help you can give me!

I cannot provide a link to what is happening with this config, but I can tell you that the wordpress index file is being hit. Unfortunately it's being downloaded instead of run though in Chrome.

hello

$
0
0
Hi all from Amsterdam

I'm new to NGINX and a developer and here to learn more from you all experienced fellows.
And I hope some my post will get attention in a good way to all experienced guys out there to sort out my problems.

[ANN] OpenResty 1.11.2.5 released

$
0
0
Hi folks,

I am excited to announce the new formal release, 1.11.2.5, of the
OpenResty web platform based on NGINX and LuaJIT:

https://openresty.org/en/download.html

Both the (portable) source code distribution, the Win32 binary
distribution, and the pre-built binary Linux packages for all those
common Linux distributions are provided on this Download page.

Special thanks go to all our developers and contributors! And thanks
OpenResty Inc. for sponsoring most of the OpenResty core development
work.

We did not have enough time to upgrade the bundled NGINX core in this
release as originally planned. Sorry about that. We'll definitely try
upgrading the NGINX core to the mainstream 1.13.4+ versions in the
next OpenResty release.

We have the following highlights in this release:

1. New real-time in-memory nginx error log capturing API. Now it's
easy to inspect nginx error logs on the Lua land without accessing any
files.

2. Ability to launch a privileged agent process under the master,
which runs under the same system account as master. This process does
not handle any incoming traffic, but can do system operations work and
nginx master management via signals. The user can run Lua code in this
special process via init_worker_by_lua*. This does not work on Win32
though.

3. Now the Lua light threads can voluntarily yield the execution
control to the nginx event loop without introducing any extra delays
(previously it requires an extra delay of at least 1 millisecond).
This is achieved by the ngx.sleep(0) call on the Lua land.

4. New ngx.timer.every() Lua API for easily creating recurring timers
on the Lua land.

5. New Lua API function for tuning the JIT stack size of PCRE.

6. New Lua API for fetching the current nginx error_log filtering
level in efffect.

7. Now we search for LuaJIT bytecode files *.ljbc in the default
Lua module search paths before searching *.lua files.

8. Enforces nginx to do graceful shutdown even in single process mode
(i.e., master_process is off). This does not work on Win32 though.

The complete change log since the last (formal) release, 1.11.2.4:

* feature: applied a patch to the nginx core to make the nginx
variable $proxy_add_x_forwarded_for accessible on Lua land.
thanks spacewander for the patch.

* feature: added the balancer-status-code patch to the nginx core
to allow returning arbitrary HTTP status codes inside upstream
balancers. thanks Datong Sun for the patch.

* feature: we now search LuaJIT bytecode files "*.ljbc" before Lua
source files "*.lua" in the default Lua module search paths.

* feature: applied the intercept-error-log patch to the nginx core
to provide 3rd-party modules a hook to intercept nginx error log
data without touching files. 3rd-party modules can register a
custom interception hook to
"ngx_http_core_main_conf_t.intercept_log_handler". thanks
Yuansheng Wang for the patch.

* feature: "./configure": the user flags specified by the
"--with-luajit-xcflags=FLAGS" option are not appended to the
default flags instead of being prepended. thanks spacewander for
the report.

* feature: applied a small patch to the nginx core to add support
for the "privileged agent" process which is run by the same
system account as the master. thanks Yuansheng Wang for the
patch.

* change: applied a patch to the nginx core to turn nginx to
openresty in the builtin special response pages' footer. thanks
Datong Sun for the patch.

* bugfix: the feature test for SSE 4.2 support did not really
check if the local CPU indeed has it. thanks Jukka Raimovaara
for the patch.

* bugfix: applied the single-process-graceful-exit patch to the
nginx core to fix the issue that nginx fails to perform graceful
exit when "master_process" is turned off.

* bugfix: "./configure": the "--without-http_lua_upstream" option
alone incorrectly disabled all the Lua stuff.

* feature: applied the delayed-posted-events patch to the nginx
core for adding "delayed posted events" which run in the next
event cycle with 0 delay. this nginx core feature is needed by
the "ngx.sleep(0)" feature in ngx_lua, for example. thanks
Datong Sun for the patch.

* change: swtched to OpenResty's own fork of "ngx_postgres":
https://github.com/openresty/ngx_postgres

* doc: updated the LuaJIT restydoc indexes to the latest version.

* upgraded resty-cli to 0.19.

* feature: resty: added new command-line option
"--errlog-level LEVEL". thanks Michal Cichra for the patch.

* feature: resty: added new command-line option "--rr" to use
"rr record" to run the underlying C process. this is for
Mozilla rr recording.

* feature: resty: added new command-line option "--gdb" to use
gdb to run the underlying C process.

* feature: resty: implemented the "--http-conf CONF"
command-line option.

* feature: added the "--ns IP" command line options to
override system (or google) nameservers. thanks Aapo
Talvensaari for the patch.

* bugfix: we did not quote the Lua code chunk names properly.

* bugfix: bad Lua file names given on the command line might
give rise to strange errors and even hanging.

* bugfix: resty: user created timers and unwaited light
threads were not handled gracefully upon exit.

* bugfix: md2pod.pl: we did not unescape "&ast;".

* optimize: resty: now we increase the value of
lua_regex_cache_max_entries to 40K.

* doc: made it clear that one should install "openresty-resty"
and/or "openresty-doc" if they uses the offiical OpenResty
pre-built Linux package repositories.

* upgraded ngx_lua to 0.10.10.

* feature: added pure C API for tuning the "jit_stack_size"
option in PCRE. this is used by the ngx.re library of
lua-resty-core. thanks Andreas Lubbe for the patch.

* feature: added pure C functions
"ngx_http_lua_ffi_worker_type()" &
"ngx_http_lua_ffi_worker_privileged()" for the ngx.process
module in lua-resty-core. thanks Yuansheng Wang for the
patch.

* feature: added new config directive lua_intercept_error_log
for capturing nginx error logs on Lua land. the
corresponding Lua API is provided by the ngx.errlog module
in lua-resty-core. thanks Yuansheng Wang for the patch and
Jan Prachař for a bug fix.

* feature: implemented the ngx.timer.every() API function for
creating recurring timers. thanks Dejiang Zhu for the patch.

* feature: balancer_by_lua*: now the user Lua code can
terminate the current request with arbitrary HTTP response
status codes via ngx.exit(). thanks Datong Sun for the
patch.

* feature: added pure C API function
"ngx_http_lua_ffi_errlog_get_sys_filter_level" for the
"ngx.errlog" module's "get_sys_filter_level()" function in
the lua-resty-core library. thanks spacewander for the
patch.

* feature: "ngx.sleep(0)" now always yield the control to the
nginx event loop. this can be used to do voluntary CPU time
slicing when running CPU intensive computations on the Lua
land and to avoid such computations from blocking the nginx
event loop for too long. this feature requires OpenResty's
delayed-posted-event patch for the nginx core. thanks Datong
Sun for the patch.

* feature: added new pure C API
"ngx_http_lua_ffi_process_signal_graceful_exit()" for the
signal_graceful_exit() function of the ngx.process module in
lua-resty-core.

* feature: nginx 1.11.11+ can now build with this module.
note: nginx 1.11.11+ are still not an officially supported
target yet. thanks Andrei Belov for the patch.

* bugfix: the running timer counter might go out of sync when
non-timer handlers using fake requests are involved (like
ssl_certficate_by_lua* and ssl_session_fetch_by_lua*).
thanks guanglinlv for the patch.

* bugfix: ngx.encode_args() did not escape "|", ",", "$", "@",
and "`". now it is now consistent with what Google Chrome's
JavaScript API function "encodeURIComponent()" does. thanks
goecho for the patch.

* bugfix: ngx.escape_uri() did not escape "|", ",", "$", "@",
and "`".

* bugfix: segmentation fault would occur when several server
{} blocks listen on the same port or unix domain socket file
path *and* some of them are using ssl_certificate_by_lua*
configurations while some are not. thanks petrovich-ua for
the report and original patch.

* bugfix: the fake requests/connections might leak when memory
allocations fail. thanks skyever for the patch.

* bugfix: segmentation fault might happen when a stale read
event happens after the downstream cosocket object is
closed. thanks Dejiang Zhu for the report.

* bugfix: ngx.semaphore: when nginx workers exit, the harmless
error message "semaphore gc wait queue is not empty" might
be logged. thanks Yuansheng Wang for the patch.

* bugfix: fixed typos in error messages. thanks spacewander
for the patch.

* refactor: ocsp: removed a useless line of code, which
unbreak the libressl build. thanks Kyra Zimmer for the
original patch.

* doc: fixed a typo in a code example for "ngx.re.match".
thanks Ming Wen for the patch.

* upgraded lua-resty-core to 0.1.12.

* feature: added opt() function to the ngx.re Lua module that
accepts the "jit_stack_size" option to tune the JIT stack
size of PCRE. thanks Andreas Lubbe for the patch.

* feature: added new Lua module ngx.process which has
functions type() and enable_privileged_agent(). thanks
Yuansheng Wang for the patch.

* feature: added new Lua module ngx.errlog which provides Lua
API to capture nginx error log data on Lua land. thanks
Yuansheng Wang for the patch.

* feature: added the new signal_graceful_exit() function to
the ngx.process Lua module.

* feature: ngx.errlog: added the get_sys_filter_level() API
function to get the "system" error log filtering level
defined in nginx.conf's error_log directive. thanks
spacewander for the patch.

* bugfix: ngx.re: split() might enter infinite loops when the
regex yields matches with empty captures. thanks Thibault
Charbonnier for the patch.

* optimize: simplified the "BOOL and true or false"
expressions. thanks Evgeny S for the patch.

* doc: ngx.ssl: added performace notes for set_priv_key() and
set_cert(). thanks Filip Slavik for the patch.

* doc: ngx.balancer: fixed some typos. thanks detailyang for
the patch.

* doc: code example: private keys are usually stored in PEM,
so we use the func priv_key_pem_to_der in the example to do
the conversion. thanks soul11201 for the patch.

* doc: ngx.ssl.session: fixed the missing arguments in the
code example. thanks soul11201 for the patch.

* doc: fixed the code examples since directives
"ssl_session_*_by_lua*" are no longer allowed in "server
{}". thanks Yuansheng Wang for the patch.

* upgraded lua-resty-dns to 0.19.

* feature: added support for SOA typed queries. thanks Ming
Wen for the patch.

* upgraded lua-resty-mysql to 0.20.

* feature: connect(): added the charset option to specify the
connection charset. thanks Wilhelm Liao for the patch.

* feature: added support for "FIELD_TYPE_DECIMAL" for MySQL
servers prior to 5.0 and 5.0. thanks panyingxue for the
patch.

* bugfix: newer versions of MySQL use length-encoded strings
for the human readable "info" message in MySQL's "OK
packet". thanks zhuanyenan for the report.

* upgraded lua-resty-lock to 0.07.

* feature: added new method expire() that can change the TTL
of the lock being held. thanks Datong Sun for the patch.

* upgraded lua-resty-string to 0.10.

* bugfix: resty.aes: fixed memory overrun bug when user
provided a salt of less than 8 characters but
"EVP_BytesToKey()" expects more. disallows salt strings
longer than 8 characters to avoid false sense of security.
thanks Datong Sun for the patch.

* refactor: commented out unneeded locals, and removed unused
variable declarations. thanks Aapo Talvensaari for the
patch.

* doc: typo fixes from Juarez Bochi.

* upgraded lua-resty-upstream-healthcheck to 0.05.

* optimize: removed useless code. thanks Yuansheng Wang for
the patch.

* doc: typo fixes from Mike Rostermund.

* upgraded lua-resty-limit-traffic to 0.04.

* bugfix: reduce race condition between get/incr(key). by
using "incr" first, we could avoid overcommits between
"get(key)" and "incr(key)". thanks spacewander for the
patch.

* upgraded lua-resty-lrucache to 0.07.

* bugfix: fixed a type mismatch issue found by 其实不想走. the old
form still works due to LuaJIT FFI's magic.

* upgraded ngx_lua_upstream to 0.07.

* bugfix: turning a peer up via set_peer_down() did not reset
the peer's "fails" counter, which might get the peer to be
marked down again prematurely. thanks letian for the patch.

* doc: documented the "down" key in the get_primary_peers()
result. thanks Kipras Mancevičius for the patch.

* upgraded ngx_echo to 0.61.

* feature: nginx 1.11.11+ can now build with this module.
note: nginx 1.11.11+ are still not an officially supported
target yet. thanks Andrei Belov for the patch.

* doc: minor typo fixes from mrefish and Mathieu Aubin.

* doc: added a note about the empty values of
$echo_client_request_headers in HTTP/2 requests.

* upgraded ngx_postgres to 1.0.

* feature: fixed compilation errors with nginx 1.9.1+. thanks
Vadim A. Misbakh-Soloviov for the original patch.

* feature: fixed the compilation errors with nginx 1.11.6+.

* upgraded LuaJIT to v2.1-20170808:
https://github.com/openresty/luajit2/tags

* bugfix: FFI C parsers could not parse some C constructs like
"__attribute((aligned(N)))" and "#pragma". decoupled hash
functions used in comparison (hardcoded) and string table.
thanks Shuxin Yang for the patch. this bug had first
appeared in v2.1-20170405 (or OpenResty 1.11.2.3).

* bugfix: fixed a clang warning in "lj_str.c" regarding unused
"str_fastcmp()" when macro "LUAJIT_USE_VALGRIND" is defined.

* imported Mike Pall's latest changes:

* bugfix: added missing "LJ_MAX_JSLOTS" check, which might
lead to JIT stack overflow when exceeding this limit.
tracked down the Mozilla rr tool. already merged in
upstream LuaJIT.

* FreeBSD/x64: Avoid changing resource limits, if not
needed.

* PPC: Add soft-float support to interpreter.

* x64/"LJ_GC64": Fix "emit_rma()".

* MIPS64: Add soft-float support to JIT compiler backend.

* MIPS: Fix handling of spare long-range jump slots.

* MIPS: Use precise search for exit jump patching.

* Add FOLD rules for mixed BAND/BOR with constants.

* FFI: Compile bitfield loads/stores.

* Add workaround for MSVC 2015 stdio changes.

* MIPS64: Fix stores of MULTRES.

* MIPS64: Fix write barrier in "BC_USETV".

* ARM64: Fix stores to vmstate.

* From Lua 5.2: Add "lua_tonumberx()" and
"lua_tointegerx()".

* From Lua 5.2: Add "luaL_setmetatable()".

* From Lua 5.2: Add "luaL_testudata()".

* From Lua 5.3: Add "lua_isyieldable()".

* From Lua 5.2: Add "lua_copy()".

* From Lua 5.2: Add "lua_version()".

* OSX: Fix build with recent XCode.

* Allow building on Haiku OS. Note: this is not an
officially supported target.

The HTML version of the change log with lots of helpful hyper-links
can be browsed here:

https://openresty.org/en/changelog-1011002.html

OpenResty is a full-fledged web platform
by bundling the standard Nginx core, Lua/LuaJIT, lots of
3rd-party Nginx modules and Lua libraries, as well as most of their external
dependencies. See OpenResty's homepage for details:

https://openresty.org/

We have run extensive testing on our Amazon EC2 test cluster and
ensured that all the components (including the Nginx core) play well
together. The latest test report can always be found here:

https://qa.openresty.org/

We also always run the latest OpenResty version in our own global CDN
network (dubbed "mini CDN") powering our openresty.org and other
sites.

Enjoy!

Best regards,
-agentzh
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Nginx stopped suddenly

$
0
0
Hi All,

I am using nginx for routing the incoming requests to web application and resources path. But sometime nginx suddenly stopped working. I could not able to identify the actual root cause.

Following is the nginx conf file and attached error log....
--------------------------------------------------------------------------------
user nginx;
worker_processes 4;

error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 150;

#gzip on;
client_max_body_size 200M;
server_names_hash_bucket_size 64;
#include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name localhost max_fails=3;

#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;

proxy_buffering off;
proxy_buffer_size 4k;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 10M;
sendfile on;
send_timeout 300s;

location / {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
#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;
#}
}
server {
listen 90;
server_name localhost;


location / {
root html;
index index.html index.htm;
}


location /local/var/www/images {
alias /home/nwook/work/upload/data;
}
}

}
--------------------------------------------------------------------
Please let us know the reason for stopping nginx suddenly..

nginx and uwsgi in docker in vagrant in vmware - Permission denied on socket

$
0
0
Don't ask why, but on my mac I am running Windows Server 2016 in
VMware. In there I am running Ubuntu in vagrant/Virtual Box. In there
I am trying to run a django app in a docker container with
nginx/uwsgi.

The socket is being created, but then when I try and connect to the
site it fails with this nginx error:

2017/08/19 16:56:29 [crit] 1251#1251: *1 connect() to
unix:///opt/django/CAPgraph/app.sock failed (13: Permission denied)
while connecting to upstream, client: 10.0.2.2, server: , request:
"GET / HTTP/1.1", upstream:
"uwsgi://unix:///opt/django/CAPgraph/app.sock:", host:
"localhost:9003"


I have verified that the app.sock file and all dirs along the path are
777. The /opt/django/CAPgraph dir is a docker volume mounted from a
local dir in the vagrant/Virtual Box VM

How can I debug this further?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Viewing all 53287 articles
Browse latest View live


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