# Jpeg image quality is bad

**URL:** <https://www.ruby-forum.com/t/jpeg-image-quality-is-bad/227808>\
**Category:** NGINX\
**Created:** [March 29, 2013, 5:45am UTC](https://www.ruby-forum.com/t/jpeg-image-quality-is-bad/227808 "2013-03-29T05:45:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Praveen\_Yarlagadda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b4bc9f/32.png) [@Praveen\_Yarlagadda](https://www.ruby-forum.com/u/Praveen_Yarlagadda)\
**Post date:** [March 29, 2013, 5:45am UTC](https://www.ruby-forum.com/t/jpeg-image-quality-is-bad/227808/1 "2013-03-29T05:45:30Z")

</div>

Hi there!

I’m playing around with nginx and I’m running into a problem related to  
image uploading. I have nginx as a load balancer and java server (jetty,  
spring based) as the backend server. When I upload an image (JPEG) using  
POST method via nginx, the quality gets dropped a lot. Please take a  
look  
at the attached image. If I upload it directly to the backend server, it  
gets saved properly. Am I missing anything in the conf file? I really  
appreciate your help. Here is my nginx.conf.

_http {_

- include /etc/nginx/mime.types;\*
- default\_type application/octet-stream;\*
- 
- 
- #access\_log /dev/null main;\*
- access\_log /data/logs/nginx/access.log main;\*
- log\_not\_found off;\*
- 
- 
- sendfile on;\*
- #tcp\_nopush on;\*
- 
- 
- keepalive\_timeout 65;\*
- 
- 
- client\_max\_body\_size 10M;\*
- 
- 
- 
- 
- #gzip on;\*
- 
- 
- include /etc/nginx/conf.d/_.conf;_
- 
- 
- 
- 
- upstream backend {\*
- 

```
   ip_hash;*

```

- 

```
   server example.com:7070;*

```

- }\*
- 
- 
- 
- 
- server {\*
- 

```
 listen 80;*

```

- 

```
 server_name example.com;*

```

- 
- 
- 

```
 location / {*

```

- 

```
       proxy_pass http://backend;*

```

- 

```
       proxy_buffering on;*

```

- 

```
 }*

```

- 
- 
- }\*
- 
- 
- server {\*
- 

```
   listen 80;*

```

- 

```
   server_name ~.*;*

```

- 

```
   location / {*

```

- 

```
     access_log off;*

```

- 

```
     return 503;*

```

- 

```
   }*

```

- }\*  
_}_

Thanks a lot!

-Praveen

---

<div class="post-metadata">

**Author:** ![Praveen\_Yarlagadda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b4bc9f/32.png) [@Praveen\_Yarlagadda](https://www.ruby-forum.com/u/Praveen_Yarlagadda)\
**Post date:** [March 29, 2013, 5:57am UTC](https://www.ruby-forum.com/t/jpeg-image-quality-is-bad/227808/2 "2013-03-29T05:57:46Z")

</div>

Hi,

On Thu, 2013-03-28 at 21:44 -0700, Praveen Yarlagadda wrote:

> ```
> ip_hash;
> 
> listen 80;
> 
> ```
> 
> -Praveen
> 
> * * *

nginx does nothing whatsoever to images. They’re just files as far as  
it’s concerned. It looks like your site must post-process them in some  
way… resample, reduce quality, etc???

Cheers,

Steve
