WordPress LMS for Web and mobile Forums Ionic App Support Httaccess Code on NGINX

Httaccess Code on NGINX

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17783

    Hilman Fajrian
    Participant

    Hi,

    My production/live site is using NGIX, not Apache. So I dont have .htaccess. My site engineer told me the app httaccess code needs to be converted to NGIX.

    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$1

    Need help to do this.

    #17804

    Alex
    Keymaster

    Well its a very common issue . Please refer .

    I think there are ways to add support for .htaccess file on nginx  server .

    You can refer this link :

    https://github.com/WP-API/Basic-Auth/issues/35#issuecomment-394583376

    #17805

    Hilman Fajrian
    Participant

    @Alex

    My Kinsta hosting engineer asked me to ask you this question:

    Since we use Nginx on Kinsta, .htaccess rules do not work here and can also not be implemented to work here at this point. We understand that the rule

    SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1

    is trying to pass a header for HTTP Authorization. We would translate it to this Nginx header after having seen a similar case on the web:

    fastcgi_pass_header Authorization;

    Can you verify this is what is needed?

     

    Please inform and I will forward your answer to my hosting engineer. Thank you.

    #17807

    Alex
    Keymaster

    Well I also do not have much knowledge about this .

    the issue is that we are passing an authorization token into headers which is sent as ” Authorizartion ” is being stripped and never reaches the php code .

    where we are parsing it using $_SERVER php global variable .

    refer :

    https://github.com/WP-API/Basic-Auth/issues/35#issuecomment-394583376 

     

    by adding that rule in .htaccess file server does not strips this header

    #17809

    Scott Lang
    Keymaster

    Yes this looks good. Make sure you restart the server to apply the conf values.

     fastcgi_pass_request_headers on;
        fastcgi_pass_header Authorization;
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.