Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- # Site Directory same in the apache virtualhost configuration
- root /var/www/html;
- index index.php index.html index.htm;
- # Domain
- server_name www.reverse.com reverse.com;
- location / {
- try_files $uri $uri/ /index.php;
- }
- # Reverse Proxy and Proxy Cache Configuration
- location ~ \.php$ {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_set_header Host $host;
- proxy_pass http://127.0.0.1:8080;
- # Cache configuration
- proxy_cache reverse_cache;
- proxy_cache_valid 3s;
- proxy_no_cache $cookie_PHPSESSID;
- proxy_cache_bypass $cookie_PHPSESSID;
- proxy_cache_key "$scheme$host$request_uri";
- add_header X-Cache $upstream_cache_status;
- }
- # Enable Cache the file 30 days
- location ~* .(jpg|png|gif|jpeg|css|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ {
- proxy_cache_valid 200 120m;
- expires 30d;
- proxy_cache reverse_cache;
- access_log off;
- }
- # Disable Cache for the file type html, json
- location ~* .(?:manifest|appcache|html?|xml|json)$ {
- expires -1;
- }
- location ~ /\.ht {
- deny all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement