server {

    1. listen 80;
    2. root /var/www/Group-co;
    3. server_name groupco.com;
    4. location / {
    5. try_files $uri @rewriteapp;
    6. }
    7. location @rewriteapp {
    8. rewrite ^(.*)$ /index.php$1 last;
    9. }
    10. location ~ ^/(index)\.php(/|$) {
    11. proxy_set_header X-Real-IP $remote_addr;
    12. proxy_set_header X-Forwarded-For $remote_addr;
    13. proxy_set_header Host $host;
    14. proxy_pass http://127.0.0.1:9777;
    15. }
    16. location ~* \.(jpg|jpeg|gif|png|ico|swf)$ {
    17. expires 3y;
    18. access_log off;
    19. gzip off;
    20. }
    21. # 配置css/js文件
    22. location ~* \.(css|js)$ {
    23. access_log off;
    24. expires 3y;
    25. }

    }