403 Forbidden, Nignx

Yunior Miguel A. lists at ruby-forum.com
Fri Mar 22 20:46:00 UTC 2013

Hello again:

I am have public a redmine and other aplication with nginx the other
aplication is make in php, the php aplication have a api direccion for
some services, when i put the url of de aplication without the api all
is fine and not hae problem, but when I try to access the application
using the API URL the following error appears:

                            403 Forbidden

this is my nginx configuration for de php aplication.

server {
        listen   80;
        server_name  appphp.nginx.com;
        root   /var/www/appphp;
        index  index.php, index.html;
        location / {
          include /etc/nginx/proxy_opts;
         proxy_redirect off;
                     error_page 404  404.html;
         error_page 500 502 503 504  500.html;
         access_log /var/log/nginx/appphp.access.log;
         error_log  /var/log/nginx/appphp.error.log;

         gzip on;
        gzip_min_length 1000;
        gzip_types text/plain text/css application/x-javascript text/xml
application/xml application/xml+rss #text/javascript;
        gzip_disable "MSIE [1-6]\.";

        charset utf-8;

  location ~ "^(.+\.php)($|/)" {

           set $script $uri;
           set $path_info "/";

          if ($uri ~ "^(.+\.php)($|/)") {
          set $script $1;

          if ($uri ~ "^(.+\.php)(/.+)") {
          set $script $1;
          set $path_info $2;

          include /etc/nginx/fastcgi_params;

          fastcgi_param SCRIPT_FILENAME appphp.nginx.com$script;
          fastcgi_param SCRIPT_NAME $script;
          fastcgi_param PATH_INFO $path_info;


proxy_opts configurations:

# Shared options used by all proxies
proxy_set_header        Host $http_host;

# Following headers are not used by Redmine but may be useful for
plugins and
# other web applications
proxy_set_header        X-Real-IP $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        X-Forwarded-Proto $scheme;

# Any other options for all proxies here
client_max_body_size       10m;
client_body_buffer_size    128k;

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;

Posted via http://www.ruby-forum.com/.

More information about the nginx mailing list