uwsgi nginx lua,我只见过 500 服务器错误。 uwsgi 仅记录重新生成

发布于 2024-12-20 15:38:52 字数 2086 浏览 2 评论 0原文

好的,这是我已经尝试过的,在 nginx 上,

#location ~ \.lua$ {
#    include uwsgi_params;
#    uwsgi_modifier1 6;
#    uwsgi_pass unix:/var/run/uwsgi/luajit/socket;
#}


#location ~ / {
#                include uwsgi_params;
#                uwsgi_param UWSGI_FILE $request_filename;
#                uwsgi_param UWSGI_TOUCH_RELOAD $request_filename;
#                uwsgi_param SCRIPT_NAME $uri;
#                uwsgi_modifier1 9;
#                if (-f $request_filename) {
#                 uwsgi_pass unix:/var/run/uwsgi/luajit/socket;
#
#                }
#        }
#location ~ \.cgi$ {
#    include fastcgi_params;
#    fastcgi_pass unix:/var/run/uwsgi/luajit/socket;
#    uwsgi_modifier1 9;
#
#}

#location ~ / {
#                include uwsgi_params;
#                uwsgi_param UWSGI_FILE test.cgi;
#                uwsgi_param SCRIPT_NAME test.cgi;
#                uwsgi_modifier1 9;
#3uwsgi_pass unix:/var/run/uwsgi/luajit/socket;
#        }

这是我的 uwsgi,配置

default.xml

<uwsgi>
    <autoload>true</autoload>
    <master>true</master>
    <threads>25</threads>
    <workers>2</workers>
    <no-orphans>true</no-orphans>
    <pidfile>/var/run/uwsgi/%n/pid</pidfile>
    <socket>/var/run/uwsgi/%n/socket</socket>
    <chmod-socket>660</chmod-socket>
    <log-date>true</log-date>
    <uid>www-data</uid>
    <gid>www-data</gid>
</uwsgi>

luajit.xml

<uwsgi>
    <plugins>luajit</plugins>
    <protocol>uwsgi</protocol>
</uwsgi>

我已经尝试过很多方法,我什至已经记不清了。我什至无法通过常规 cgi 得到任何东西。我更喜欢这样做,

test.lua > wsapi> luajit插件uwsgi服务器> uwsgi协议> 但实际上

在这一点上,我希望 uwsgi 能够工作。我在 Ubuntu 上运行它,所以它是 uwsgi 的 debianized 模块化版本。

我可以像这样运行传统的 cgi 风格脚本吗?什么是 wsapi.cgi?它是将 lua cgi 包装为 wsapi,还是将 lua wsapi 包装为 cgi。

我很迷茫,已经这样了快一个星期了。

非常感谢任何帮助。甚至只是为了把我推向正确的方向。 我找不到任何文档或文章。这就是我发帖的原因。

Ok here is what I have already tried, on the nginx

#location ~ \.lua$ {
#    include uwsgi_params;
#    uwsgi_modifier1 6;
#    uwsgi_pass unix:/var/run/uwsgi/luajit/socket;
#}


#location ~ / {
#                include uwsgi_params;
#                uwsgi_param UWSGI_FILE $request_filename;
#                uwsgi_param UWSGI_TOUCH_RELOAD $request_filename;
#                uwsgi_param SCRIPT_NAME $uri;
#                uwsgi_modifier1 9;
#                if (-f $request_filename) {
#                 uwsgi_pass unix:/var/run/uwsgi/luajit/socket;
#
#                }
#        }
#location ~ \.cgi$ {
#    include fastcgi_params;
#    fastcgi_pass unix:/var/run/uwsgi/luajit/socket;
#    uwsgi_modifier1 9;
#
#}

#location ~ / {
#                include uwsgi_params;
#                uwsgi_param UWSGI_FILE test.cgi;
#                uwsgi_param SCRIPT_NAME test.cgi;
#                uwsgi_modifier1 9;
#3uwsgi_pass unix:/var/run/uwsgi/luajit/socket;
#        }

here is my uwsgi, config

default.xml

<uwsgi>
    <autoload>true</autoload>
    <master>true</master>
    <threads>25</threads>
    <workers>2</workers>
    <no-orphans>true</no-orphans>
    <pidfile>/var/run/uwsgi/%n/pid</pidfile>
    <socket>/var/run/uwsgi/%n/socket</socket>
    <chmod-socket>660</chmod-socket>
    <log-date>true</log-date>
    <uid>www-data</uid>
    <gid>www-data</gid>
</uwsgi>

luajit.xml

<uwsgi>
    <plugins>luajit</plugins>
    <protocol>uwsgi</protocol>
</uwsgi>

I have tried doing this so many way, I have even lost count. I couldn't even get anything doing regular cgi. I prefer to do it like this,

test.lua > wsapi > luajit plugin uwsgi server > uwsgi protocol > nginx

But really at this point, i would like uwsgi work at all. I am running this on Ubuntu, so it is the debianized modular version of uwsgi.

can i run legacy cgi style scripts like this? what is wsapi.cgi? does it wrap lua cgi as wsapi, or lua wsapi as cgi.

I'm so lost, been at this for almost a week.

Would really appreciate any help. Even just to push me in the correct direction.
I was unable to find any documentation, or write-ups. which is why I'm posting.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫南 2024-12-27 15:38:52

这是官方文档:http://projects.unbit.it/uwsgi/wiki/Lua

你应该构建最新版本(最好使用 1.0 分支),因为 debian 软件包不包含最新的 lua 补丁。

关于cgi,nginx不支持,uWSGI中的插件还不完整。

This is the official doc: http://projects.unbit.it/uwsgi/wiki/Lua

You should build latest versions (better going with 1.0 branch) as debian packages does not containes latest lua patches.

Regarding cgi, nginx does not support it, and the plugin in uWSGI is still incomplete.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文