[kwlug-disc] nginx config question
Mikalai Birukou
mb at 3nsoft.com
Thu Sep 28 03:59:40 EDT 2023
On 2023-09-28 02:25, Ronald Barnes wrote:
> I've switched everything over to nginx and have a question.
>
>
> I include a lot of config snippets, including one that checks for /ping,
> /status, etc.
>
> Those have stanzas like this:
>
> location /ping {
> include fastcgi.conf;
>
> ## This MUST run on the NORMAL listening socket, NOT the special
> ## pm.status_listen defined in /etc/php/$version/fpm/pool.d/www.conf:
> fastcgi_pass unix:/run/php/php-fpm.sock;
> }
>
>
> The server block that includes it might look like this:
>
> server {
> listen 80 ;
>
> server_name nextcloud.bclug.ca;
>
> ## Enable responses to /ping ... "pong", etc:
> include ./sites-available/shared/ping.conf;
>
> return 301 https://$host$request_uri;
> }
return not in location block ?
Even if it is legal, can you try a capture all locations with location
block, placing "return ..." in it, and see if it changes anything.
>
> So... if I `curl nextcloud.bclug.ca/ping` I want "pong", not a 301
> redirect to https://nextcloud.bclug.ca/ping (which works).
>
>
> Is there a way to do this? I might be missing some critical
> understanding of nginx.
>
> I'm trying to avoid repeating the location blocks that are being included...
>
>
> The include statement is repeated in the https section, and it works.
>
> If I use `curl -L nextcloud.bclug.ca/ping` then I do get "pong" after
> the redirect.
>
>
> Can the redirect be avoided for /ping ?
>
>
> Thanks!
>
> rb
>
> _______________________________________________
> kwlug-disc mailing list
> To unsubscribe, send an email to kwlug-disc-leave at kwlug.org
> with the subject "unsubscribe", or email
> kwlug-disc-owner at kwlug.org to contact a human being.
More information about the kwlug-disc
mailing list