regarding nginx optimization

I was reading the following guide for optimizing nginx server

https://www.linode.com/docs/web-servers … erformance">https://www.linode.com/docs/web-servers/nginx/configure-nginx-for-optimized-performance

in the later part part is suggested to add

location / {
            proxy_pass         http://127.0.0.1/;
            proxy_redirect     off;
            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_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;
            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;
            proxy_temp_path            /etc/nginx/proxy_temp;
        }

now, im using php application, so should all be going inside location ~ \.php$ or location / as the guide states?

also can i put all inside main nginx config file /etc/nginx/nginx.conf inside http block? would that work as same?

thanks in advance.

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct