Giter Site home page Giter Site logo

Implement Nginx X-Accel-Redirect about fm HOT 7 CLOSED

zazza avatar zazza commented on August 22, 2024
Implement Nginx X-Accel-Redirect

from fm.

Comments (7)

akuznecov avatar akuznecov commented on August 22, 2024

I have added a new configuration variable to enable this header.
Also nginx configuration should include

        location ^~ /upload {
                internal;
        }

or

        location ^~ /upload {
                root /path/to/fm/document/root;
                internal;
        }

from fm.

Zazza avatar Zazza commented on August 22, 2024

Right?

server {
listen 80;
server_name domen.com;
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?main=$1 last;
}
location / {
root /home/www/domen.com/public/;
proxy_pass 127.0.0.1:81;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
}
location ^~ /upload {
internal;
}
}

I haven't enough experience with nginx. I used it only for a proxy of request

from fm.

akuznecov avatar akuznecov commented on August 22, 2024

For just proxification you should move root directive to server block, or directly to upload location.

See my conf: http://pastebin.com/2GuunCPc

from fm.

akuznecov avatar akuznecov commented on August 22, 2024

Btw, It requires additional rules for securing application folders, that done with .htaccess files..
or changing structure to front/protected directories

from fm.

Zazza avatar Zazza commented on August 22, 2024

ok, thanks! it is possible I will write on a ostora site for an example your nginx conf?

from fm.

akuznecov avatar akuznecov commented on August 22, 2024

Of course : )

I have added restrictions for system and upload directories, and removed PHP values(it was added for my own configuration, to increase limits, but avoid changing php.ini or FPM configuraion)

New conf here: http://pastebin.com/0DdjBAAt

from fm.

Zazza avatar Zazza commented on August 22, 2024

by the evening i will change!

from fm.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.