default.conf 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. lua_code_cache off;
  2. lua_package_path '/usr/share/lua/5.1/?.lua';
  3. lua_package_cpath '/usr/lib/lua/5.1/?.so';
  4. server {
  5. listen 80;
  6. server_name localhost;
  7. #charset koi8-r;
  8. #access_log /var/log/nginx/host.access.log main;
  9. error_log /dev/stderr info;
  10. location / {
  11. root /usr/local/openresty/nginx/html;
  12. index index.html index.htm;
  13. rewrite_by_lua_file /usr/local/openresty/scw/scw.lua;
  14. }
  15. location /lua {
  16. content_by_lua_block {
  17. ngx.header.content_type = "text/plain"
  18. ngx.say("Hallo " .. ngx.val.uri .. "!")
  19. }
  20. }
  21. #error_page 404 /404.html;
  22. # redirect server error pages to the static page /50x.html
  23. #
  24. error_page 500 502 503 504 /50x.html;
  25. location = /50x.html {
  26. root /usr/local/openresty/nginx/html;
  27. }
  28. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  29. #
  30. #location ~ \.php$ {
  31. # proxy_pass http://127.0.0.1;
  32. #}
  33. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  34. #
  35. #location ~ \.php$ {
  36. # root /usr/local/openresty/nginx/html;
  37. # fastcgi_pass 127.0.0.1:9000;
  38. # fastcgi_index index.php;
  39. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  40. # include fastcgi_params;
  41. #}
  42. # deny access to .htaccess files, if Apache's document root
  43. # concurs with nginx's one
  44. #
  45. #location ~ /\.ht {
  46. # deny all;
  47. #}
  48. }