# Gallery 3.0.4 on nginx

**URL:** <https://www.ruby-forum.com/t/gallery-3-0-4-on-nginx/222123>\
**Category:** NGINX\
**Created:** [August 13, 2012, 3:48pm UTC](https://www.ruby-forum.com/t/gallery-3-0-4-on-nginx/222123 "2012-08-13T15:48:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [August 13, 2012, 3:48pm UTC](https://www.ruby-forum.com/t/gallery-3-0-4-on-nginx/222123/1 "2012-08-13T15:48:31Z")

</div>

Hello, i cant run gallery3 on ongix. Now i use this configure:

server {  
listen (…);  
server\_name \*.wmp.(…) wmp.(…);

```
    access_log /home/wmp/www/wmp.(...)/logs/access.log;
    error_log /home/wmp/www/wmp.(...)/logs/error.log;

    root /home/wmp/www/wmp.(...)/htdocs;
    index index.php index.html;
    autoindex off;

    location /gallery3 {
            if_modified_since off;
            add_header Last-Modified "";
            fastcgi_index index.php;
            fastcgi_split_path_info ^(.+.php)(.*)$;
            index index.php;
            if (-f $request_filename) {
                    expires max;
                    break;
            }
            if (!-e $request_filename) {
                    rewrite ^/gallery3/index.php/(.+)$

```

/gallery3/index.php?kohana\_uri=$1 last;  
}  
}

```
    location ~ \.php$ {
            include /etc/nginx/fastcgi_params;
            fastcgi_index index.php;
            fastcgi_pass unix:/var/run/nginx/wmp.php-fpm.socket;
            fastcgi_param SCRIPT_FILENAME

```

$document\_root$fastcgi\_script\_name;  
}  
}

This is my files in htdocs/gallery3:  
$ ls htdocs/gallery3/  
LICENSE README application index.php installer lib modules  
php.ini robots.txt system themes var  
$

## On this configure i have 404 on css and JS files on gallery3/combined.

Marcin Janowski(WMP)

---

<div class="post-metadata">

**Author:** ![Marcin\_SSSWMPSSSS\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8edcca/32.png) [@Marcin\_SSSWMPSSSS\_J](https://www.ruby-forum.com/u/Marcin_SSSWMPSSSS_J)\
**Post date:** [August 13, 2012, 3:52pm UTC](https://www.ruby-forum.com/t/gallery-3-0-4-on-nginx/222123/2 "2012-08-13T15:52:01Z")

</div>

And on other links on gallery3/ (eq: gallery3/user\_profile/show/2 or  
gallery3/logout) i have 404.

2012/8/13 Marcin “WMP” Janowski [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> ```
> index index.php index.html;
> break;
> fastcgi_pass unix:/var/run/nginx/wmp.php-fpm.socket;
> 
> ```
> 
> ## On this configure i have 404 on css and JS files on gallery3/combined.
> 
> Marcin Janowski(WMP)

–  
Marcin Janowski(WMP)
