For Nginx server configuration, use Lua to interact with MySQL DATA

Source: Internet
Author: User

Simple Nginx Configuration

Link Configuration of Nginx and MySQL Databases

One service configuration in http: listening port, server name, disabling lua_code_cache (debugging Nginx with different restarts), root directory setting, default page, and session key

2. Send login information from html to Nginx, and Nginx reads MySQL and judges

1 cookies go to the logon page without logon information


2 login.html: Submitted/logincheck to the http server <Strong? Http: www.bkjia.com kf ware vc "target =" _ blank "class =" keylink "> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140425/2014042509102321.jpg" alt = "\">

3/logincheck: checklong. Lua (registered cookies are only valid for the/private directory)


4. checklogin. lua sends/login_check to the server (why do you want to send it separately? you can send it to other servers to solve the high concurrency problem)

5. After Successful Logon, go to the private page and add cookies (this can be achieved. Close the page and re-enter the/private page. No more logon pages will be transferred to the personal page)

6. Delete cookies after logging out.


Effect 3

Login

Enter

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.