ini 单页面应用程序的配置(框架:Angularjs,Web服务器:Nginx)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini 单页面应用程序的配置(框架:Angularjs,Web服务器:Nginx)相关的知识,希望对你有一定的参考价值。

server {
  listen 80 default deferred;

  server_name myapp.com;

  root /var/www/project-folder/;

  # Nginx and Angularjs with html mode 5 - https://gist.github.com/cjus/b46a243ba610661a7efb
  index index.html;

  location / {
    try_files $uri $uri/ /index.html;
  }

  # Location of asset folder
  location ~ ^/(assets)/  {
    gzip_static on;
    gzip_types text/plain text/xml text/css 
      text/comma-separated-values
      text/javascript application/x-javascript
      application/atom+xml;

    expires max;
  }

  # Defines the URI that will be shown for the specified errors. 
  # error_page directives are inherited from the previous level 
  # only if there are no error_page directives defined on the current level. 
  # A uri value can contain variables.
  error_page  404 /404.html;

  # Sets the maximum allowed size of the client request body, 
  # specified in the “Content-Length” request header field. 
  # If the size in a request exceeds the configured value, 
  # the 413 (Request Entity Too Large) error is returned to the client. 
  # Please be aware that browsers cannot correctly display this error. 
  # Setting size to 0 disables checking of client request body size.
  client_max_body_size 4G;

  # The first parameter sets a timeout during which a keep-alive 
  # client connection will stay open on the server side. 
  # The zero value disables keep-alive client connections. 
  # The optional second parameter sets a value in the “Keep-Alive: timeout=time” response header field. 
  # Two parameters may differ.
  keepalive_timeout 10;
}

以上是关于ini 单页面应用程序的配置(框架:Angularjs,Web服务器:Nginx)的主要内容,如果未能解决你的问题,请参考以下文章

Angular有何优势?为何备受程序猿喜爱?

H5单页面架构:requirejs + angular + angular-route

Angular学习总结

单页面应用

前端都有啥框架 其特点

AngularJ