Nginx + Tomcat configuration, static resources directly using Nginx myeclipse tomcat configuration tomcat download Eclipse configuration Tomcat

Source: Internet
Author: User
Java code

  1. Upstream Tomcat_server {
  2. Server 127.0. 0.1:8080;
  3. }
  4. server {
  5. Listen ;
  6. server_name localhost;
  7. Root D:\work\my-project;
  8. Location/{
  9. Index index.jsp;
  10. }
  11. Location/j_spring_security_check {
  12. Proxy_set_header Host $host;
  13. Proxy_set_header x-forwarded-for $remote _addr;
  14. Proxy_pass http://tomcat_server;
  15. }
  16. Location ~. *\. (jsp| do) $ {
  17. Proxy_set_header Host $host;
  18. Proxy_set_header x-forwarded-for $remote _addr;
  19. Proxy_pass http://tomcat_server;
  20. }
  21. Location ~. *\. (gif|jpg|jpeg|png|bmp|swf|js|css|html) $ #设定访问静态文件直接读取不经过tomcat
  22. {
  23. Expires 30d;
  24. }
  25. Location ~ ^/(web-inf)/{#这个很重要, otherwise users can access the
  26. Deny all;
  27. }
  28. Error_page 502 503 504 /50x.html;
  29. Location =/50x.html {
  30. root HTML;
  31. }
  32. }

The above describes the Nginx + Tomcat configuration, static resources directly using Nginx, including the Tomcat configuration aspects, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.